Say only what a tail coupler does: end signals or none

The simulator reads the last vehicle's coupler for one thing, whether to put
up the end signals. It does not couple the train to anything behind it, as
the tooltip and a comment claimed.
This commit is contained in:
maj00r
2026-10-04 18:57:58 +02:00
parent 53fe9aa48c
commit 2e7e967279
8 changed files with 13 additions and 13 deletions

View File

@@ -18,8 +18,8 @@ public class CouplerLookTests
[Theory]
[InlineData("0", CouplerState.EndSignals)]
[InlineData("0.BP", CouplerState.EndSignals)]
[InlineData("3", CouplerState.CoupledBehind)]
[InlineData("-7", CouplerState.CoupledBehind)]
[InlineData("3", CouplerState.NoEndSignals)]
[InlineData("-7", CouplerState.NoEndSignals)]
public void The_back_of_the_train_gets_end_signals_only_at_0(string code, CouplerState expected) =>
Assert.Equal(expected, CouplerLook.StateOf(Coupling.Parse(code), trailing: true));
}

View File

@@ -638,7 +638,7 @@ public sealed class Consist : IReadOnlyList<ConsistItem>
/// <summary>
/// Clears the coupler at the back of the consist, unless it was set in the
/// editor. The simulator hangs the end signals only on a last vehicle whose
/// coupler is 0 - anything else couples it to whatever stands behind - and every
/// coupler is 0 - the code does nothing else at the back of a train - and every
/// new car comes with 3. Its parameters, the brake setting among them, stay.
/// </summary>
private void FreeTail()

View File

@@ -22,8 +22,8 @@ public enum CouplerState
/// <summary>The back of the train at 0 - the simulator puts up the end signals.</summary>
EndSignals,
/// <summary>The back of the train coupled to whatever stands behind it - no end signals.</summary>
CoupledBehind
/// <summary>The back of the train at anything but 0 - no end signals, and nothing else.</summary>
NoEndSignals
}
/// <summary>How a coupler is drawn on the consist strip, so its state reads at a glance.</summary>
@@ -39,7 +39,7 @@ public static class CouplerLook
{
int flags = coupling.AbsFlags;
if (trailing)
return flags == 0 ? CouplerState.EndSignals : CouplerState.CoupledBehind;
return flags == 0 ? CouplerState.EndSignals : CouplerState.NoEndSignals;
if (flags == 0)
return CouplerState.Free;
if (coupling.Locked || (flags & Coupling.WorkshopLock) != 0)
@@ -63,7 +63,7 @@ public static class CouplerLook
CouplerState.MultipleUnit => Green,
CouplerState.Permanent => Blue,
CouplerState.EndSignals => Red,
CouplerState.CoupledBehind => Amber,
CouplerState.NoEndSignals => Amber,
_ => null
};
@@ -82,7 +82,7 @@ public static class CouplerLook
{
CouplerState.Free => App.Loc["CouplerFree"],
CouplerState.EndSignals => App.Loc["CouplerEndSignals"],
CouplerState.CoupledBehind => string.Format(App.Loc["CouplerCoupledBehind"], connections),
CouplerState.NoEndSignals => App.Loc["CouplerNoEndSignals"],
_ => string.Format(App.Loc["CouplerConnects"], connections)
};

View File

@@ -290,7 +290,7 @@
<String key="CouplerFree">Vozidla nejsou spojena.</String>
<String key="CouplerConnects">Spojeno: {0}</String>
<String key="CouplerEndSignals">Konec soupravy — simulátor vyvěsí koncovky.</String>
<String key="CouplerCoupledBehind">Konec soupravy se spřáhne s tím, co stojí za ní ({0}) — bez koncovek.</String>
<String key="CouplerNoEndSignals">Jiný kód než 0 na konci soupravy — simulátor nevyvěsí koncovky.</String>
<String key="CouplerLocked">Zablokováno — při posunu se nerozpojí.</String>
<String key="CouplerClickToEdit">Klikněte pro změnu.</String>
<String key="AddVehicle">Přidat</String>

View File

@@ -290,7 +290,7 @@
<String key="CouplerFree">The vehicles are not coupled.</String>
<String key="CouplerConnects">Connected: {0}</String>
<String key="CouplerEndSignals">End of the train — the simulator puts up the end signals.</String>
<String key="CouplerCoupledBehind">The end of the train couples to whatever stands behind it ({0}) — no end signals.</String>
<String key="CouplerNoEndSignals">Anything but 0 at the back of the train — the simulator puts up no end signals.</String>
<String key="CouplerLocked">Locked — not uncoupled in shunting.</String>
<String key="CouplerClickToEdit">Click to change.</String>
<String key="AddVehicle">Add</String>

View File

@@ -290,7 +290,7 @@
<String key="CouplerFree">A járművek nincsenek összekapcsolva.</String>
<String key="CouplerConnects">Összekapcsolva: {0}</String>
<String key="CouplerEndSignals">A szerelvény vége — a szimulátor kiteszi a zárjelzőket.</String>
<String key="CouplerCoupledBehind">A szerelvény vége összekapcsolódik a mögötte állóval ({0}) — zárjelzők nélkül.</String>
<String key="CouplerNoEndSignals">A szerelvény végén 0-tól eltérő kód — a szimulátor nem teszi ki a zárjelzőket.</String>
<String key="CouplerLocked">Zárolva — tolatáskor nem bontható.</String>
<String key="CouplerClickToEdit">Kattints a módosításhoz.</String>
<String key="AddVehicle">Hozzáadás</String>

View File

@@ -290,7 +290,7 @@
<String key="CouplerFree">Pojazdy nie są połączone.</String>
<String key="CouplerConnects">Połączone: {0}</String>
<String key="CouplerEndSignals">Koniec składu — symulator wystawi końcówki.</String>
<String key="CouplerCoupledBehind">Koniec składu sprzęgnie się z tym, co stoi za nim ({0}) — bez końcówek.</String>
<String key="CouplerNoEndSignals">Kod inny niż 0 na końcu składu — symulator nie wystawi końcówek.</String>
<String key="CouplerLocked">Zablokowany — nie rozprzęga się przy manewrach.</String>
<String key="CouplerClickToEdit">Kliknij, aby zmienić.</String>
<String key="AddVehicle">Dodaj</String>

View File

@@ -290,7 +290,7 @@
<String key="CouplerFree">Вагоны не сцеплены.</String>
<String key="CouplerConnects">Соединено: {0}</String>
<String key="CouplerEndSignals">Хвост поезда — симулятор вывесит хвостовые сигналы.</String>
<String key="CouplerCoupledBehind">Хвост поезда сцепится с тем, что стоит за ним ({0}) — без хвостовых сигналов.</String>
<String key="CouplerNoEndSignals">Код, отличный от 0, в хвосте поезда — симулятор не вывесит хвостовые сигналы.</String>
<String key="CouplerLocked">Заблокирована — не расцепляется при маневрах.</String>
<String key="CouplerClickToEdit">Нажмите, чтобы изменить.</String>
<String key="AddVehicle">Добавить</String>