Files
StarterNG/StarterNG/Classes/AppState.cs
maj00r 3b7a8135ea Strip all comments from the C# sources
Removes every // and /// comment from the 28 .cs files, -1331 lines.

Done with a lexer rather than a regex: the sources carry plenty of // inside
string literals (@"//\$decor\b", the //$o trainset directives, sb.Append("// "),
"https://wiki.eu07.pl/") and those must survive. It tracks regular, verbatim and
interpolated strings, interpolation holes and char literals. Every file was
checked by comparing the sequence of string-literal characters before and after
the strip; all 28 match. BOMs preserved, blank-line runs collapsed to one.

Claude-Session: https://claude.ai/code/session_01HamVNWE9mwmz1vs2iEpNQq
2026-08-29 16:42:11 +02:00

50 lines
1.1 KiB
C#

using System;
namespace StarterNG.Classes;
public sealed class AppState
{
public static AppState Instance { get; } = new();
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();
}