mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 02:56:01 +01:00
Merge pull request #281 from MaSzyna-EU07/feat/shunt-pantograph-config
AI: suggested pantograph setup for shunting in the .fiz (eu07/maszyna#461)
This commit is contained in:
31
tests/unit/test_ai_hints.cpp
Normal file
31
tests/unit/test_ai_hints.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "stdafx.h"
|
||||
#include "doctest.h"
|
||||
#include "vehicle.h"
|
||||
|
||||
using test::definition;
|
||||
using test::vehicle;
|
||||
|
||||
// the hints for the AI driver from the AI section of the .fiz
|
||||
|
||||
TEST_CASE("ai hints: without the AI section the pantographs follow the built-in logic") {
|
||||
vehicle wagon{definition::load("wagon")};
|
||||
|
||||
CHECK(wagon->AIHintPantstate == 0);
|
||||
CHECK(wagon->AIHintShuntPantstate == 0);
|
||||
CHECK(wagon->AIHintPantUpIfIdle);
|
||||
}
|
||||
|
||||
TEST_CASE("ai hints: the suggested pantograph setup for shunting is read apart from the one for train mode") {
|
||||
// eu07/maszyna#461: so the ET41 doesn't shunt with all of its four pantographs up
|
||||
vehicle shunting{definition::load("wagon").set("AI", "Pantstate", 1).set("AI", "ShuntPantstate", 2)};
|
||||
|
||||
CHECK(shunting->AIHintPantstate == 1);
|
||||
CHECK(shunting->AIHintShuntPantstate == 2);
|
||||
}
|
||||
|
||||
TEST_CASE("ai hints: a .fiz with the setup for train mode only has none for shunting") {
|
||||
vehicle train{definition::load("wagon").set("AI", "Pantstate", 3)};
|
||||
|
||||
CHECK(train->AIHintPantstate == 3);
|
||||
CHECK(train->AIHintShuntPantstate == 0);
|
||||
}
|
||||
Reference in New Issue
Block a user