18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 21:45:16 +01:00
Files
maszyna/world/timetablestart.h
jerrrrycho 2f12768815 fix(timetable): the station of departure written in capitals is still a stop (#343)
The first row of a timetable, which usually gives only the departure time,
became a stop only when its name matched the relation's first station
case-sensitively. Os33733 of linia_107_poludnie.scn writes ZAGORZ in the rows
and Zagorz in the relation, so its driver counted Zagorz as passed at the
start, left before its departure time and the train manager never gave the
departure signal. The names are now compared regardless of case
(timetable::starts_at in the core library).

Tests: unit test of the rule; td.scn scenario cases with a timetable of the
case's own (first row STACJA1, and Stacja1 as control) and the td.scn train
started with its head 80 m past the W4 of Stacja1; the scenario runner can
copy a timetable of the case into the game for the run.
2026-11-20 16:35:59 +01:00

24 lines
796 B
C++

/*
This Source Code Form is subject to the
terms of the Mozilla Public License, v.
2.0. If a copy of the MPL was not
distributed with this file, You can
obtain one at
http://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <string_view>
// the first row of a timetable
namespace timetable {
// whether the first row of a timetable is the station the train sets off from: it names the station
// the relation starts at. such a row is a stop even with no arrival time given, the train waits there
// for its departure time. the names are compared regardless of case, as the timetables write the
// station of departure in capitals as often as not (ZAGORZ in the rows, Zagorz in the relation)
bool starts_at(std::string_view Firststation, std::string_view Relationfrom);
} // namespace timetable