Departures: Simplify struct CallAt operators

This commit is contained in:
Jonathan G Rennison 2024-09-09 17:39:10 +01:00
parent 8e0a1fa8ae
commit e964e1a9d3

View File

@ -47,30 +47,12 @@ struct CallAt {
CallAt(const StationID& s, StateTicks t) : station(s), scheduled_tick(t) { }
CallAt(const CallAt& c) : station(c.station), scheduled_tick(c.scheduled_tick) { }
inline bool operator==(const CallAt& c) const {
inline bool operator==(const CallAt& c) const
{
return this->station == c.station;
}
inline bool operator!=(const CallAt& c) const {
return this->station != c.station;
}
inline bool operator>=(const CallAt& c) const {
return this->station == c.station &&
this->scheduled_tick != 0 &&
c.scheduled_tick != 0 &&
this->scheduled_tick >= c.scheduled_tick;
}
CallAt& operator=(const CallAt& c) {
this->station = c.station;
this->scheduled_tick = c.scheduled_tick;
return *this;
}
inline bool operator==(StationID s) const {
return this->station == s;
}
CallAt& operator=(const CallAt& c) = default;
};
struct RemoveVia {