mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-10-16 23:49:19 +02:00
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:
25
StarterNG.Tests/CouplerLookTests.cs
Normal file
25
StarterNG.Tests/CouplerLookTests.cs
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user