17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 18:22:15 +01:00

Merge pull request #167 from pwarszawski/whois-station-ahead

whois: add lookahead mode for the timetable entry after the next stop
This commit is contained in:
2026-11-07 20:28:22 +00:00
committed by GitHub
3 changed files with 42 additions and 1 deletions

View File

@@ -77,6 +77,15 @@ bool TTrainParameters::IsLastStop() const {
return StationIndex >= StationCount;
}
TMTableLine const &TTrainParameters::TimeTableEntryAhead( int Offset ) const
{ // wpis rozkladu Offset pozycji za aktualnym (bez pomijania przelotow);
// poza zakresem 1..StationCount zwraca techniczny wpis zerowy
int const idx { StationIndex + Offset };
if( ( idx < 1 ) || ( idx > StationCount ) )
return TimeTable[0];
return TimeTable[idx];
}
bool TTrainParameters::IsMaintenance() const {
if( StationIndex <= StationCount )