Rewrite the ATC logic

Now signals store speed information with a timeout for this data's validity
This commit is contained in:
Andreas Schmitt
2021-06-19 23:01:12 +02:00
parent 61669868bf
commit c1bf236a26
3 changed files with 87 additions and 75 deletions

View File

@@ -147,6 +147,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
uint16 reverse_distance;
uint16 tunnel_bridge_signal_num;
uint16 speed_restriction;
uint16 signal_speed_restriction;
/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
Train() : GroundVehicleBase() {}
@@ -190,7 +191,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
};
private:
int GetAtcMaxSpeed(int current_max_speed) const;
int GetAtcMaxSpeed() const;
MaxSpeedInfo GetCurrentMaxSpeedInfoInternal(bool update_state) const;
public: