Colour the depot couplers by what they connect

Each coupler on the consist strip now shows its state: free, coupled,
multiple-unit, permanent, and at the back whether the end signals go up.
The tooltip gives the code and the connections instead of the drag hint,
and the flyout edits mark the coupler as set by hand and restyle it in
place. The note about 0 on the last vehicle is gone - the colour says it.
This commit is contained in:
maj00r
2026-10-04 18:55:16 +02:00
parent 36dd4a020f
commit 00a62ab568
9 changed files with 211 additions and 26 deletions

View File

@@ -0,0 +1,25 @@
using StarterNG.Classes;
using StarterNG.Views;
namespace StarterNG.Tests;
public class CouplerLookTests
{
[Theory]
[InlineData("0", CouplerState.Free)]
[InlineData("3", CouplerState.Coupled)]
[InlineData("7", CouplerState.MultipleUnit)]
[InlineData("131", CouplerState.Permanent)]
[InlineData("-3", CouplerState.Permanent)]
[InlineData("0.BP", CouplerState.Free)]
public void A_coupler_between_vehicles_reads_by_what_it_connects(string code, CouplerState expected) =>
Assert.Equal(expected, CouplerLook.StateOf(Coupling.Parse(code), trailing: false));
[Theory]
[InlineData("0", CouplerState.EndSignals)]
[InlineData("0.BP", CouplerState.EndSignals)]
[InlineData("3", CouplerState.CoupledBehind)]
[InlineData("-7", CouplerState.CoupledBehind)]
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));
}