mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-03 13:00:22 +01:00
Take the remaining I/O out of the domain and drop AppState.Instance
Scenery translations and load weights get repositories; AppState moves to the application layer.
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using StarterNG.Classes;
|
||||
using StarterNG.Domain.Sceneries;
|
||||
using StarterNG.Domain.Vehicles;
|
||||
using StarterNG.Application;
|
||||
|
||||
namespace StarterNG.Domain;
|
||||
|
||||
@@ -170,7 +171,7 @@ public sealed class Consist : IReadOnlyList<ConsistItem>
|
||||
|
||||
var driven = item.Cars.FirstOrDefault(c =>
|
||||
c.DriverType is eDriverType.Headdriver or eDriverType.Reardriver);
|
||||
AppState.Instance.StartingVehicleName = (driven ?? item.Cars[0]).Name;
|
||||
AppServices.Current.State.StartingVehicleName = (driven ?? item.Cars[0]).Name;
|
||||
}
|
||||
|
||||
public Dynamic MakeDynamic(VehicleTexture texture, Scenery? scenery)
|
||||
@@ -324,7 +325,7 @@ public sealed class Consist : IReadOnlyList<ConsistItem>
|
||||
if (ReferenceEquals(Selected, item))
|
||||
SyncStartingVehicle();
|
||||
Raise();
|
||||
AppState.Instance.NotifyChanged();
|
||||
AppServices.Current.State.NotifyChanged();
|
||||
}
|
||||
|
||||
public void Split(ConsistItem item)
|
||||
|
||||
Reference in New Issue
Block a user