Files
StarterNG/StarterNG/Application/AppState.cs
maj00r df21ec104f Cut the comments from the refactored code
Three survive: why AppServices is hand-wired, the cp1250 registration trap, and
the IsDieselEngine note carried over from Physics.cs.
2026-09-04 22:24:54 +02:00

51 lines
1.1 KiB
C#

using System;
using StarterNG.Domain.Sceneries;
using StarterNG.Classes;
namespace StarterNG.Application;
public sealed class AppState
{
public event Action? Changed;
private Scenery? _currentScenery;
private Trainset? _currentTrainset;
private string? _startingVehicleName;
public Scenery? CurrentScenery
{
get => _currentScenery;
set
{
if (ReferenceEquals(_currentScenery, value)) return;
_currentScenery = value;
Changed?.Invoke();
}
}
public Trainset? CurrentTrainset
{
get => _currentTrainset;
set
{
if (ReferenceEquals(_currentTrainset, value)) return;
_currentTrainset = value;
Changed?.Invoke();
}
}
public string? StartingVehicleName
{
get => _startingVehicleName;
set
{
if (_startingVehicleName == value) return;
_startingVehicleName = value;
Changed?.Invoke();
}
}
public void NotifyChanged() => Changed?.Invoke();
}