diff --git a/StarterNG/Application/Abstractions/IClock.cs b/StarterNG/Application/Abstractions/IClock.cs
index b3fa40d..97f0c2c 100644
--- a/StarterNG/Application/Abstractions/IClock.cs
+++ b/StarterNG/Application/Abstractions/IClock.cs
@@ -2,11 +2,6 @@ namespace StarterNG.Application.Abstractions;
using System;
-///
-/// Port over the system clock. Scenery weather defaults, timetable rendering and
-/// log timestamps all depend on "now"; routing them through a clock keeps those
-/// rules deterministic under test.
-///
public interface IClock
{
DateTime Now { get; }
diff --git a/StarterNG/Application/Abstractions/IDiagnosticsLog.cs b/StarterNG/Application/Abstractions/IDiagnosticsLog.cs
index aa049b4..a5a0765 100644
--- a/StarterNG/Application/Abstractions/IDiagnosticsLog.cs
+++ b/StarterNG/Application/Abstractions/IDiagnosticsLog.cs
@@ -3,11 +3,6 @@ using System.Collections.Generic;
namespace StarterNG.Application.Abstractions;
-///
-/// Port over the starter's error log. Domain and application code depends on
-/// this interface only; the file-backed implementation and the message box that
-/// surfaces faults to the user live in Infrastructure and Presentation.
-///
public interface IDiagnosticsLog
{
void Log(string message);
@@ -16,7 +11,6 @@ public interface IDiagnosticsLog
void Log(IEnumerable messages);
- /// Everything logged so far, newline separated.
string Text { get; }
void Clear();
diff --git a/StarterNG/Application/Abstractions/IEnvironment.cs b/StarterNG/Application/Abstractions/IEnvironment.cs
index aad2b85..bc614ab 100644
--- a/StarterNG/Application/Abstractions/IEnvironment.cs
+++ b/StarterNG/Application/Abstractions/IEnvironment.cs
@@ -1,9 +1,5 @@
namespace StarterNG.Application.Abstractions;
-///
-/// The bits of the host machine the starter has to ask about: which operating
-/// system it is on, and where that system keeps per-user configuration.
-///
public interface IEnvironment
{
bool IsWindows { get; }
@@ -12,9 +8,7 @@ public interface IEnvironment
bool IsMacOS { get; }
- /// An environment variable, or null when it is not set.
string? GetVariable(string name);
- /// The folder the starter's own executable lives in.
string BaseDirectory { get; }
}
diff --git a/StarterNG/Application/Abstractions/IFileSystem.cs b/StarterNG/Application/Abstractions/IFileSystem.cs
index fe381c5..93c1083 100644
--- a/StarterNG/Application/Abstractions/IFileSystem.cs
+++ b/StarterNG/Application/Abstractions/IFileSystem.cs
@@ -5,18 +5,6 @@ using System.Text;
namespace StarterNG.Application.Abstractions;
-///
-/// Port over the file system. Everything that reads or writes the MaSzyna
-/// installation goes through this interface instead of and
-/// , so parsers and use cases can be exercised against an
-/// in-memory installation in tests.
-///
-///
-/// Kept deliberately narrow: only the operations the application actually
-/// performs are exposed. Paths are passed through verbatim to the adapter, which
-/// resolves them relative to the process working directory just like the
-/// framework methods it replaces.
-///
public interface IFileSystem
{
bool FileExists(string path);
@@ -45,23 +33,13 @@ public interface IFileSystem
void CopyFile(string sourcePath, string destinationPath, bool overwrite);
- /// Top-level files, empty when the directory does not exist.
IReadOnlyList GetFiles(string path, string searchPattern = "*");
- /// Top-level directories, empty when the directory does not exist.
IReadOnlyList GetDirectories(string path);
- ///
- /// Files matching the pattern anywhere below the path. Empty when the
- /// directory does not exist.
- ///
IReadOnlyList GetFilesRecursive(string path, string searchPattern);
DateTime GetLastWriteTimeUtc(string path);
- ///
- /// Whether the file carries an execute bit. Always true on Windows, where
- /// executability is a property of the file's contents rather than its mode.
- ///
bool IsExecutable(string path);
}
diff --git a/StarterNG/Application/Abstractions/IGamePaths.cs b/StarterNG/Application/Abstractions/IGamePaths.cs
index 464cf37..314647c 100644
--- a/StarterNG/Application/Abstractions/IGamePaths.cs
+++ b/StarterNG/Application/Abstractions/IGamePaths.cs
@@ -1,34 +1,20 @@
namespace StarterNG.Application.Abstractions;
-///
-/// The layout of a MaSzyna installation. Replaces the
-/// Directory.GetCurrentDirectory() calls and hard-coded "scenery/",
-/// "dynamic", "textures/mini/" literals that were previously spread across
-/// parsers, views and the loader.
-///
public interface IGamePaths
{
- /// Installation root: the folder holding eu07.exe.
string Root { get; }
- /// Scenery definitions (*.scn).
string Scenery { get; }
- /// Rolling stock: dynamic/<maker>/<vehicle>/textures.txt.
string Dynamic { get; }
- /// Vehicle thumbnails used by the depot and the consist strip.
string MiniTextures { get; }
- /// Simulator data files (load_weights.txt and friends).
string Data { get; }
- /// Starter-owned configuration: presets, profiles, key bindings.
string StarterConfig { get; }
- /// The starter's own error log (starter/bledy.txt).
string DiagnosticsLog { get; }
- /// Resolves a path relative to .
string FromRoot(params string[] segments);
}
diff --git a/StarterNG/Application/Abstractions/ILocalizedStrings.cs b/StarterNG/Application/Abstractions/ILocalizedStrings.cs
index f72ce5b..826d732 100644
--- a/StarterNG/Application/Abstractions/ILocalizedStrings.cs
+++ b/StarterNG/Application/Abstractions/ILocalizedStrings.cs
@@ -1,19 +1,9 @@
namespace StarterNG.Application.Abstractions;
-///
-/// Port over the translation table. Anything that needs a user-facing string
-/// takes this, rather than reaching for the concrete localization service or a
-/// static on App.
-///
public interface ILocalizedStrings
{
- ///
- /// Translation for a key. Missing keys return the key itself (and are logged
- /// once), so an untranslated screen stays usable.
- ///
string this[string key] { get; }
- /// Lookup for a key that may legitimately be absent; "" when missing.
string Opt(string key);
string CurrentLanguage { get; }
diff --git a/StarterNG/Application/Abstractions/IMiniTextureIndex.cs b/StarterNG/Application/Abstractions/IMiniTextureIndex.cs
index d876765..1edadd4 100644
--- a/StarterNG/Application/Abstractions/IMiniTextureIndex.cs
+++ b/StarterNG/Application/Abstractions/IMiniTextureIndex.cs
@@ -1,19 +1,12 @@
namespace StarterNG.Application.Abstractions;
-///
-/// The thumbnails in textures/mini, looked up by name. Backed by one directory
-/// scan; a name with no bitmap falls back to the generic "other" thumbnail.
-///
public interface IMiniTextureIndex
{
- /// Builds the index up front, off the UI thread.
void Preload();
bool Has(string? miniName);
- /// Bitmap for the name, the fallback thumbnail, or null when neither exists.
string? PathFor(string? miniName);
- /// The generic thumbnail shown for unknown stock.
string? FallbackPath { get; }
}
diff --git a/StarterNG/Application/Abstractions/IPhysicsRepository.cs b/StarterNG/Application/Abstractions/IPhysicsRepository.cs
index 44e9a63..d479167 100644
--- a/StarterNG/Application/Abstractions/IPhysicsRepository.cs
+++ b/StarterNG/Application/Abstractions/IPhysicsRepository.cs
@@ -2,20 +2,11 @@ using StarterNG.Domain.Vehicles;
namespace StarterNG.Application.Abstractions;
-///
-/// Looks up the .fiz physics of a vehicle type by model name.
-///
public interface IPhysicsRepository
{
- /// Indexes the installation's .fiz files up front, off the UI thread.
void Preload();
- /// How many vehicle types were indexed; zero means a broken installation.
int IndexedCount { get; }
- ///
- /// Physics for a model name (with or without extension), or null when the
- /// installation has no .fiz for it.
- ///
VehiclePhysics? For(string? dataFolder, string? model);
}
diff --git a/StarterNG/Application/Abstractions/IProcessLauncher.cs b/StarterNG/Application/Abstractions/IProcessLauncher.cs
index 7029f36..a8ecab1 100644
--- a/StarterNG/Application/Abstractions/IProcessLauncher.cs
+++ b/StarterNG/Application/Abstractions/IProcessLauncher.cs
@@ -4,12 +4,6 @@ using System.Threading.Tasks;
namespace StarterNG.Application.Abstractions;
-///
-/// A process the starter has launched or adopted. Exposes only what the starter
-/// needs — whether the simulator is still up, and a way to await its exit — so
-/// the presentation layer never handles
-/// directly.
-///
public interface IProcessHandle
{
bool HasExited { get; }
@@ -17,26 +11,12 @@ public interface IProcessHandle
Task WaitForExitAsync(CancellationToken cancellationToken = default);
}
-///
-/// Port over process creation: starting the simulator, opening a file, folder or
-/// URL in the desktop shell, and adopting an already running simulator.
-///
public interface IProcessLauncher
{
- ///
- /// Starts an executable with the given arguments. Returns null when the
- /// process could not be created; then carries the
- /// reason for display.
- ///
IProcessHandle? Start(string executablePath, IReadOnlyList arguments, string? workingDirectory,
out string? error);
- ///
- /// Hands a path or URL to the desktop shell (explorer, xdg-open, ...).
- /// Returns false and logs when the shell refused it.
- ///
bool OpenInShell(string pathOrUrl);
- /// The first running process with that name, or null.
IProcessHandle? FindRunning(string processName);
}
diff --git a/StarterNG/Application/Abstractions/IRandomSource.cs b/StarterNG/Application/Abstractions/IRandomSource.cs
index f5f57b2..b4403a2 100644
--- a/StarterNG/Application/Abstractions/IRandomSource.cs
+++ b/StarterNG/Application/Abstractions/IRandomSource.cs
@@ -1,15 +1,8 @@
namespace StarterNG.Application.Abstractions;
-///
-/// Port over randomness. Scenery weather deliberately varies between runs (fog
-/// distance, overcast presets, texture randomiser); routing it through a port
-/// keeps those rules assertable instead of flaky.
-///
public interface IRandomSource
{
- /// Inclusive lower bound, exclusive upper bound.
int Next(int minInclusive, int maxExclusive);
- /// Uniform value in [0, 1).
double NextDouble();
}
diff --git a/StarterNG/Application/Abstractions/ISceneryRepository.cs b/StarterNG/Application/Abstractions/ISceneryRepository.cs
index f923fc7..031b05b 100644
--- a/StarterNG/Application/Abstractions/ISceneryRepository.cs
+++ b/StarterNG/Application/Abstractions/ISceneryRepository.cs
@@ -4,21 +4,11 @@ using StarterNG.Domain.Sceneries;
namespace StarterNG.Application.Abstractions;
-/// How far a scenery sweep has got, for the splash screen.
public readonly record struct SceneryLoadProgress(int Loaded, int Total, string FileName);
-///
-/// Reads the scenarios of an installation. The only route from a .scn on disk to
-/// a ; nothing else constructs one from a path.
-///
public interface ISceneryRepository
{
- ///
- /// Every scenario in the installation, in no particular order. Files that
- /// fail to parse are logged and skipped rather than failing the load.
- ///
IReadOnlyList LoadAll(IProgress? progress = null);
- /// Reloads a single scenario; null when it is gone or unreadable.
Scenery? Load(string path);
}
diff --git a/StarterNG/Application/Abstractions/ISceneryTranslations.cs b/StarterNG/Application/Abstractions/ISceneryTranslations.cs
index 4ffdc17..de599ce 100644
--- a/StarterNG/Application/Abstractions/ISceneryTranslations.cs
+++ b/StarterNG/Application/Abstractions/ISceneryTranslations.cs
@@ -2,22 +2,9 @@ using StarterNG.Domain.Sceneries;
namespace StarterNG.Application.Abstractions;
-///
-/// The translations a scenery ships alongside itself, in scenery/i18n/*.json.
-///
-///
-/// Scenery text may be an "@key" reference rather than literal prose, resolved
-/// against the currently loaded scenery's table. The table is per scenery, so
-/// replaces it rather than adding to it.
-///
public interface ISceneryTranslations
{
- /// Loads the tables for one scenery, English first then the user's language.
void LoadFor(Scenery scenery, string langCode);
- ///
- /// Resolves an "@key" reference against the loaded table. Text that is not a
- /// reference, or a key with no translation, comes back unchanged.
- ///
string Translate(string? text);
}
diff --git a/StarterNG/Application/Abstractions/IVehicleRepository.cs b/StarterNG/Application/Abstractions/IVehicleRepository.cs
index d32247b..5e285f2 100644
--- a/StarterNG/Application/Abstractions/IVehicleRepository.cs
+++ b/StarterNG/Application/Abstractions/IVehicleRepository.cs
@@ -2,16 +2,7 @@ using StarterNG.Domain.Vehicles;
namespace StarterNG.Application.Abstractions;
-///
-/// Reads the installation's rolling stock. The only route from the dynamic/
-/// folder to a .
-///
public interface IVehicleRepository
{
- ///
- /// Fills the catalogue from every textures.txt under dynamic/. Returns the
- /// number of liveries read, which the caller uses to spot an installation
- /// with no rolling stock at all.
- ///
int Load(VehicleCatalog catalog);
}
diff --git a/StarterNG/Application/AppServices.cs b/StarterNG/Application/AppServices.cs
index d12d0f9..e223746 100644
--- a/StarterNG/Application/AppServices.cs
+++ b/StarterNG/Application/AppServices.cs
@@ -9,22 +9,9 @@ using StarterNG.Services;
namespace StarterNG.Application;
-///
-/// The composition root: the single place where concrete adapters are chosen and
-/// wired to the ports the rest of the application depends on.
-///
-///
-/// Hand-written on purpose. The starter publishes with PublishAot and
-/// PublishTrimmed, which rules out reflection-based containers; the object
-/// graph is small enough that explicit construction is also the clearest
-/// documentation of what depends on what.
-///
-/// is a service locator and is used in exactly one kind of
-/// place — the entry point and the view constructors Avalonia creates for us,
-/// which cannot take arguments. Everything below that boundary receives its
-/// dependencies through its constructor; new code must not reach for
-/// .
-///
+// Skladany recznie: PublishAot i PublishTrimmed wykluczaja kontener oparty na
+// refleksji. Current jest service locatorem i wolno go czytac tylko z entry
+// pointu i z konstruktorow widokow, ktorych Avalonia nie potrafi parametryzowac.
public sealed class AppServices
{
private static AppServices? _current;
@@ -61,16 +48,10 @@ public sealed class AppServices
StartSimulation = new StartSimulation(State, SettingsStore, files, Processes, Random, log);
}
- ///
- /// The graph built by the entry point. Throws when read before
- /// , which would mean a static initializer somewhere
- /// ran ahead of the composition root.
- ///
public static AppServices Current =>
_current ?? throw new InvalidOperationException(
"AppServices.Current read before Initialize(); the composition root must be built first.");
- /// Builds the production graph. Called once, from the entry point.
public static AppServices Initialize(IGamePaths? paths = null, IFileSystem? files = null, IClock? clock = null,
IEnvironment? environment = null)
{
@@ -114,16 +95,12 @@ public sealed class AppServices
public LoadWeightsRepository LoadWeights { get; }
- /// Everything read out of the installation: rolling stock and scenarios.
public GameLibrary Library { get; }
- /// What the user currently has selected.
public AppState State { get; }
- /// The settings the starter runs with, and their load/save lifecycle.
public SettingsStore SettingsStore { get; }
- /// Shorthand for the settings themselves.
public SimulatorSettings Settings => SettingsStore.Settings;
public ExecutableLocator Executables { get; }
@@ -132,13 +109,7 @@ public sealed class AppServices
public MissingVehicleLog MissingVehicleLog { get; }
- /// Starts the simulator on the current selection.
public StartSimulation StartSimulation { get; }
- ///
- /// Exposed as the concrete service rather than
- /// because the XAML binds to it as a change-notifying source; code should take
- /// the port.
- ///
public LocalizationService Localization { get; }
}
diff --git a/StarterNG/Application/AppState.cs b/StarterNG/Application/AppState.cs
index 105e6c7..78ab716 100644
--- a/StarterNG/Application/AppState.cs
+++ b/StarterNG/Application/AppState.cs
@@ -5,18 +5,8 @@ using StarterNG.Classes;
namespace StarterNG.Application;
-///
-/// What the user currently has selected: which scenario, which consist in it and
-/// which vehicle they will start in.
-///
-///
-/// Session state rather than domain state, which is why it lives in the
-/// application layer. Built by the composition root instead of being an ambient
-/// singleton; screens observe to stay in step.
-///
public sealed class AppState
{
- /// Raised whenever any of the selections changes.
public event Action? Changed;
private Scenery? _currentScenery;
diff --git a/StarterNG/Application/GameLibrary.cs b/StarterNG/Application/GameLibrary.cs
index 8783c09..1f94b67 100644
--- a/StarterNG/Application/GameLibrary.cs
+++ b/StarterNG/Application/GameLibrary.cs
@@ -7,7 +7,6 @@ using StarterNG.Domain.Vehicles;
namespace StarterNG.Application;
-/// Which part of the installation the loader is working through.
public enum LoadPhase
{
Vehicles,
@@ -15,19 +14,8 @@ public enum LoadPhase
Done
}
-/// How far the load has got, for the splash screen.
public readonly record struct LoadStatus(double Fraction, LoadPhase Phase, string? Detail);
-///
-/// Everything the starter reads out of the installation once: the rolling stock
-/// catalogue and the list of scenarios.
-///
-///
-/// Was the GameData singleton, which also owned directory enumeration and
-/// parallel parsing. It is now an ordinary object built by the composition root,
-/// delegating to the repositories; the loading policy (what is read, in what
-/// order, what counts as progress) is all that is left here.
-///
public sealed class GameLibrary
{
private readonly IVehicleRepository _vehicles;
@@ -53,11 +41,6 @@ public sealed class GameLibrary
public bool Loaded { get; private set; }
- ///
- /// Reads the whole installation. Vehicles first, because the scenery list
- /// resolves consists against them; the thumbnail and physics indexes are
- /// built alongside since they are independent directory scans.
- ///
public void Load(IProgress? progress = null)
{
if (Loaded)
@@ -78,7 +61,6 @@ public sealed class GameLibrary
Loaded = true;
}
- /// Re-reads the scenery folder, picking up files added since startup.
public void ReloadSceneries(IProgress? progress = null)
{
var reloaded = _sceneries.LoadAll(progress);
diff --git a/StarterNG/Application/MissingVehicleLog.cs b/StarterNG/Application/MissingVehicleLog.cs
index fa4de6c..5d3ff7e 100644
--- a/StarterNG/Application/MissingVehicleLog.cs
+++ b/StarterNG/Application/MissingVehicleLog.cs
@@ -5,15 +5,6 @@ using StarterNG.Infrastructure.Vehicles;
namespace StarterNG.Application;
-///
-/// Writes the "vehicle files that are not there" report into the diagnostics
-/// log, when the user has asked for it.
-///
-///
-/// Was a method on the settings object, which had no business scanning the
-/// installation. The setting decides whether it runs; the scan itself belongs to
-/// the vehicle side.
-///
public sealed class MissingVehicleLog
{
private readonly SimulatorSettings _settings;
diff --git a/StarterNG/Application/SettingsStore.cs b/StarterNG/Application/SettingsStore.cs
index bdd40c9..bb56352 100644
--- a/StarterNG/Application/SettingsStore.cs
+++ b/StarterNG/Application/SettingsStore.cs
@@ -9,24 +9,11 @@ using StarterNG.Infrastructure.Adapters;
namespace StarterNG.Application;
-///
-/// A screen that holds settings the user is editing and can be asked to write
-/// them back into the model before a save.
-///
-///
-/// Replaces the mutable Action? CaptureFromUi the settings model used to
-/// expose: the dependency now points the right way, from the store to an
-/// interface the view implements.
-///
public interface ISettingsCapture
{
void CaptureInto(SimulatorSettings settings);
}
-///
-/// Owns the settings the starter runs with: where they were read from, when to
-/// write them back, and which executable they point at.
-///
public sealed class SettingsStore
{
private readonly IFileSystem _files;
@@ -54,25 +41,14 @@ public sealed class SettingsStore
_encoding = LegacyText.CodePage1250;
}
- /// The settings the application is running with.
public SimulatorSettings Settings { get; } = new();
- /// The file the current settings were read from.
public string LoadedFrom { get; private set; } = string.Empty;
- /// The file a save will write to.
public string SavePath => _savePath;
- ///
- /// Registers the screen that holds pending edits, so a save can collect them
- /// first. Called by the settings view when it is created.
- ///
public void RegisterCapture(ISettingsCapture capture) => _capture = capture;
- ///
- /// Reads the user's settings, falling back to the copy shipped with the
- /// installation on a first run.
- ///
public void Load()
{
_savePath = _paths.UserConfigPath();
@@ -91,7 +67,6 @@ public sealed class SettingsStore
}
catch (Exception ex)
{
- // An unreadable ini means defaults, not a failed start.
_log.Log($"reading {path}", ex);
_config = new ConfigFile();
}
@@ -100,7 +75,6 @@ public sealed class SettingsStore
TouchConfigAge();
}
- /// Collects pending edits from the settings screen, then saves.
public void CaptureAndSave()
{
_capture?.CaptureInto(Settings);
@@ -134,7 +108,6 @@ public sealed class SettingsStore
}
}
- /// Records the ini's timestamp, so an outside edit can be noticed.
public void TouchConfigAge()
{
string path = string.IsNullOrEmpty(_savePath) ? _paths.UserConfigPath() : _savePath;
@@ -148,10 +121,6 @@ public sealed class SettingsStore
}
}
- ///
- /// True when something else has written the ini since we last touched it -
- /// the simulator itself, usually, which the starter must not clobber.
- ///
public bool IsConfigNewerOnDisk()
{
string path = string.IsNullOrEmpty(_savePath) ? _paths.UserConfigPath() : _savePath;
@@ -160,7 +129,6 @@ public sealed class SettingsStore
if (!_files.FileExists(path) || _configAgeUtc == DateTime.MinValue)
return false;
- // A second of slack: writing our own file must not count as an edit.
return _files.GetLastWriteTimeUtc(path) > _configAgeUtc + TimeSpan.FromSeconds(1);
}
catch (Exception)
@@ -172,5 +140,4 @@ public sealed class SettingsStore
public string ResolveExecutable() => _executables.Resolve(Settings, out _);
public string ResolveExecutable(out ExeProblem problem) => _executables.Resolve(Settings, out problem);
-
}
diff --git a/StarterNG/Application/StartSimulation.cs b/StarterNG/Application/StartSimulation.cs
index a6b75dd..fcfe53c 100644
--- a/StarterNG/Application/StartSimulation.cs
+++ b/StarterNG/Application/StartSimulation.cs
@@ -10,28 +10,19 @@ using StarterNG.Infrastructure.Adapters;
namespace StarterNG.Application;
-/// Why a start attempt ended the way it did.
public enum SimulationStartOutcome
{
Started,
- /// Nothing is selected to run.
NothingSelected,
- /// The scenario could not be written for the simulator to read.
ExportFailed,
- /// The executable is missing, not executable, or built for another platform.
ExecutableProblem,
- /// The executable is fine but the process would not start.
LaunchFailed
}
-///
-/// What happened, and what the caller needs in order to say so or to watch the
-/// simulator it just started.
-///
public readonly record struct SimulationStartResult(
SimulationStartOutcome Outcome,
IProcessHandle? Process = null,
@@ -39,25 +30,10 @@ public readonly record struct SimulationStartResult(
ExeProblem Problem = ExeProblem.None,
string? Detail = null);
-///
-/// Starts the simulator on the scenario and consist the user has selected.
-///
-///
-/// This was the middle of a 100-line click handler that also drove dialogs and
-/// the loading screen. The sequence itself - settle the consist's starting
-/// state, write the scenario the simulator will read, save the settings, launch -
-/// is application logic and belongs away from the window; what is left in the
-/// view is asking the user things and showing what came back.
-///
public sealed class StartSimulation
{
- ///
- /// A scenario the starter has rewritten is saved beside the original under a
- /// '$' name, which the simulator loads and the scenery list ignores.
- ///
private const char ExportPrefix = '$';
- /// Battery voltage stood in for by a token velocity, as the format demands.
private const float BatteryOnVelocity = 0.1f;
private readonly AppState _state;
@@ -78,10 +54,6 @@ public sealed class StartSimulation
_log = log;
}
- ///
- /// The vehicle the player would start in, or null when the consist has no one
- /// aboard - which is what the caller warns about before committing.
- ///
public static string? StartableVehicle(Trainset? trainset, string? preferred)
{
if (trainset is null || trainset.Vehicles.Count == 0)
@@ -101,8 +73,6 @@ public sealed class StartSimulation
return trainset.Vehicles.FirstOrDefault(CanStart)?.Name;
}
- /// Start as a free camera rather than in a vehicle.
- /// Write the settings before launching.
public SimulationStartResult Execute(bool freeFly, bool saveSettings)
{
var scenery = _state.CurrentScenery;
@@ -116,8 +86,6 @@ public sealed class StartSimulation
?? StartableVehicle(trainset, _state.StartingVehicleName);
_state.StartingVehicleName = vehicle;
- // The export always rewrites the weather block, so a run reflects what the
- // weather tab shows even when the user never touched it.
scenery.Weather.Dirty = true;
string exportName = ExportPrefix + Path.GetFileName(scenery.Path);
@@ -155,11 +123,6 @@ public sealed class StartSimulation
return new SimulationStartResult(SimulationStartOutcome.Started, process, executable);
}
- ///
- /// Applies the user's battery preference to the consist. The scenery format
- /// carries the battery state in the trainset's velocity field, so "always on"
- /// means a token non-zero value when the consist is standing still.
- ///
private void ApplyBatteryDefault(Trainset trainset)
{
if (trainset.Vehicles.Count == 0)
@@ -174,5 +137,4 @@ public sealed class StartSimulation
_ => trainset.OriginalVelocity
};
}
-
}
diff --git a/StarterNG/Controls/DetailRows.cs b/StarterNG/Controls/DetailRows.cs
index 4d325e7..706a895 100644
--- a/StarterNG/Controls/DetailRows.cs
+++ b/StarterNG/Controls/DetailRows.cs
@@ -2,28 +2,10 @@ using Avalonia.Controls;
namespace StarterNG.Controls;
-///
-/// The read-only label/value lines the depot's detail tabs are built from.
-///
-///
-/// Shared so every tab reads the same way: label in the left column, value in
-/// the right, aligned down the panel. Previously each tab built its own rows,
-/// and the texture tab glued "label: value" into a single line, which lined up
-/// with nothing.
-///
public static class DetailRows
{
- /// Shown in place of a reading a vehicle does not have.
public const string NoValue = "–";
- ///
- /// The one row shape every detail tab uses. The label column negotiates its
- /// width through the shared-size group on the host panel, so all rows in a
- /// panel line up without anyone naming a pixel count - see the Compact styles
- /// in Settings.axaml. Omitting makes it a
- /// read-only line; omitting indents a bare widget to
- /// the control column.
- ///
public static SettingRow Row(string? label = null, Control? content = null,
string? value = null, string? description = null,
string? tip = null)
@@ -43,11 +25,6 @@ public static class DetailRows
return row;
}
- ///
- /// A read-only label/value line. The dash keeps the row from collapsing when a
- /// vehicle has no reading for the field; the full value is on the tooltip, so
- /// a trimmed one is still legible.
- ///
public static SettingRow Reading(string label, string? value)
{
bool empty = string.IsNullOrWhiteSpace(value);
diff --git a/StarterNG/Controls/SettingRow.cs b/StarterNG/Controls/SettingRow.cs
index 3135314..bee10d4 100644
--- a/StarterNG/Controls/SettingRow.cs
+++ b/StarterNG/Controls/SettingRow.cs
@@ -3,13 +3,6 @@ using Avalonia.Controls;
namespace StarterNG.Controls;
-///
-/// One line of the settings panel: label on the left, the control itself in the
-/// middle, a value read-out on the right, and underneath the eu07.ini key this
-/// row writes plus an optional description.
-/// Replaces the hand-rolled StackPanel/DockPanel pattern that used to be repeated
-/// for every setting.
-///
public class SettingRow : ContentControl
{
public static readonly StyledProperty LabelProperty =
@@ -18,12 +11,6 @@ public class SettingRow : ContentControl
public static readonly StyledProperty DescriptionProperty =
AvaloniaProperty.Register(nameof(Description));
- ///
- /// The eu07.ini key this row reads and writes, shown verbatim so a user can
- /// match what they see here against the file, the wiki or a forum post. Rows
- /// that are starter-only preferences carry their "starter.*" key just the
- /// same; rows that write no key at all leave this empty.
- ///
public static readonly StyledProperty ConfigKeyProperty =
AvaloniaProperty.Register(nameof(ConfigKey));
@@ -71,19 +58,12 @@ public class SettingRow : ContentControl
UpdatePseudoClasses();
}
- ///
- /// Drives the template: an empty label lets the control span the label column,
- /// an empty description or value collapses that part of the row entirely.
- ///
private void UpdatePseudoClasses()
{
PseudoClasses.Set(":no-label", string.IsNullOrEmpty(Label));
PseudoClasses.Set(":no-description", string.IsNullOrEmpty(Description));
PseudoClasses.Set(":no-key", string.IsNullOrEmpty(ConfigKey));
PseudoClasses.Set(":no-value", string.IsNullOrEmpty(ValueText));
- // A read-only row is a label and a reading with no widget between them. The
- // reading then takes the middle column too, so a long path ellipsises instead
- // of demanding its full width from an Auto column and getting cut off.
PseudoClasses.Set(":no-content", Content is null);
}
}
diff --git a/StarterNG/Controls/SettingsSection.cs b/StarterNG/Controls/SettingsSection.cs
index cf5fa23..7cb092d 100644
--- a/StarterNG/Controls/SettingsSection.cs
+++ b/StarterNG/Controls/SettingsSection.cs
@@ -3,11 +3,6 @@ using Avalonia.Controls.Primitives;
namespace StarterNG.Controls;
-///
-/// A group of s under a flat title with an accent rule.
-/// holds an optional master switch shown on the right of the
-/// title line; the section content gates itself off it.
-///
public class SettingsSection : HeaderedContentControl
{
public static readonly StyledProperty