mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-22 00:04:57 +01:00
Rework the depot, warehouse and vehicle base
A consist added to the warehouse gets a name there. The crew type stays through loading a consist. The vehicle base window replaces the texture base. The depot follows consists changed on the scenarios page, also with the warehouse tab left open.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using StarterNG.Application;
|
||||
using StarterNG.Classes;
|
||||
using StarterNG.Domain;
|
||||
using StarterNG.Domain.Vehicles;
|
||||
@@ -87,6 +88,25 @@ public class ConsistOrientationTests
|
||||
Assert.All(consist, card => Assert.Equal(Consist.IsTurned(card.Cars[0]), card.Flipped));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void A_turned_unit_comes_back_as_it_was_from_every_load()
|
||||
{
|
||||
AppServices.Initialize(_installation.Paths, _installation.Files, _installation.Clock, _installation.Environment);
|
||||
var consist = NewConsist(out var unit);
|
||||
consist.Flip(unit);
|
||||
string[] turned = Describe(consist);
|
||||
var trainset = new Trainset("trainset a tor 0 0\nendtrainset");
|
||||
|
||||
for (int load = 0; load < 3; load++)
|
||||
{
|
||||
trainset.Vehicles = consist.Flatten();
|
||||
consist.LoadFrom(trainset);
|
||||
|
||||
Assert.True(Assert.Single(consist).Flipped);
|
||||
Assert.Equal(turned, Describe(consist));
|
||||
}
|
||||
}
|
||||
|
||||
private Consist NewConsist(out ConsistItem unit)
|
||||
{
|
||||
var consist = new Consist(_catalog, new VehicleInfo(_catalog, _installation.Physics));
|
||||
|
||||
Reference in New Issue
Block a user