mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Use override specifier for Train and RoadVehicle structs
This commit is contained in:
parent
89cf0d5da8
commit
b304c06a4a
|
@ -124,28 +124,28 @@ struct RoadVehicle FINAL : public GroundVehicle<RoadVehicle, VEH_ROAD> {
|
|||
|
||||
friend struct GroundVehicle<RoadVehicle, VEH_ROAD>; // GroundVehicle needs to use the acceleration functions defined at RoadVehicle.
|
||||
|
||||
void MarkDirty();
|
||||
void UpdateDeltaXY();
|
||||
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_ROADVEH_REVENUE : EXPENSES_ROADVEH_RUN; }
|
||||
bool IsPrimaryVehicle() const { return this->IsFrontEngine(); }
|
||||
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const;
|
||||
int GetDisplaySpeed() const { return this->gcache.last_speed / 2; }
|
||||
int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed / 2; }
|
||||
Money GetRunningCost() const;
|
||||
void MarkDirty() override;
|
||||
void UpdateDeltaXY() override;
|
||||
ExpensesType GetExpenseType(bool income) const override { return income ? EXPENSES_ROADVEH_REVENUE : EXPENSES_ROADVEH_RUN; }
|
||||
bool IsPrimaryVehicle() const override { return this->IsFrontEngine(); }
|
||||
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const override;
|
||||
int GetDisplaySpeed() const override { return this->gcache.last_speed / 2; }
|
||||
int GetDisplayMaxSpeed() const override { return this->vcache.cached_max_speed / 2; }
|
||||
Money GetRunningCost() const override;
|
||||
int GetDisplayImageWidth(Point *offset = nullptr) const;
|
||||
bool IsInDepot() const { return this->state == RVSB_IN_DEPOT; }
|
||||
bool Tick();
|
||||
void OnNewDay();
|
||||
uint Crash(bool flooded = false);
|
||||
Trackdir GetVehicleTrackdir() const;
|
||||
TileIndex GetOrderStationLocation(StationID station);
|
||||
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
|
||||
bool IsInDepot() const override { return this->state == RVSB_IN_DEPOT; }
|
||||
bool Tick() override;
|
||||
void OnNewDay() override;
|
||||
uint Crash(bool flooded = false) override;
|
||||
Trackdir GetVehicleTrackdir() const override;
|
||||
TileIndex GetOrderStationLocation(StationID station) override;
|
||||
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse) override;
|
||||
|
||||
bool IsBus() const;
|
||||
|
||||
int GetCurrentMaxSpeed() const;
|
||||
int GetCurrentMaxSpeed() const override;
|
||||
int UpdateSpeed();
|
||||
void SetDestTile(TileIndex tile);
|
||||
void SetDestTile(TileIndex tile) override;
|
||||
|
||||
protected: // These functions should not be called outside acceleration code.
|
||||
|
||||
|
|
34
src/train.h
34
src/train.h
|
@ -107,23 +107,23 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
|
|||
|
||||
friend struct GroundVehicle<Train, VEH_TRAIN>; // GroundVehicle needs to use the acceleration functions defined at Train.
|
||||
|
||||
void MarkDirty();
|
||||
void UpdateDeltaXY();
|
||||
ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_TRAIN_REVENUE : EXPENSES_TRAIN_RUN; }
|
||||
void PlayLeaveStationSound() const;
|
||||
bool IsPrimaryVehicle() const { return this->IsFrontEngine(); }
|
||||
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const;
|
||||
int GetDisplaySpeed() const { return this->gcache.last_speed; }
|
||||
int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed; }
|
||||
Money GetRunningCost() const;
|
||||
void MarkDirty() override;
|
||||
void UpdateDeltaXY() override;
|
||||
ExpensesType GetExpenseType(bool income) const override { return income ? EXPENSES_TRAIN_REVENUE : EXPENSES_TRAIN_RUN; }
|
||||
void PlayLeaveStationSound() const override;
|
||||
bool IsPrimaryVehicle() const override { return this->IsFrontEngine(); }
|
||||
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const override;
|
||||
int GetDisplaySpeed() const override { return this->gcache.last_speed; }
|
||||
int GetDisplayMaxSpeed() const override { return this->vcache.cached_max_speed; }
|
||||
Money GetRunningCost() const override;
|
||||
int GetDisplayImageWidth(Point *offset = nullptr) const;
|
||||
bool IsInDepot() const { return this->track == TRACK_BIT_DEPOT; }
|
||||
bool Tick();
|
||||
void OnNewDay();
|
||||
uint Crash(bool flooded = false);
|
||||
Trackdir GetVehicleTrackdir() const;
|
||||
TileIndex GetOrderStationLocation(StationID station);
|
||||
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
|
||||
bool IsInDepot() const override { return this->track == TRACK_BIT_DEPOT; }
|
||||
bool Tick() override;
|
||||
void OnNewDay() override;
|
||||
uint Crash(bool flooded = false) override;
|
||||
Trackdir GetVehicleTrackdir() const override;
|
||||
TileIndex GetOrderStationLocation(StationID station) override;
|
||||
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse) override;
|
||||
|
||||
void ReserveTrackUnderConsist() const;
|
||||
|
||||
|
@ -135,7 +135,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
|
|||
|
||||
void UpdateAcceleration();
|
||||
|
||||
int GetCurrentMaxSpeed() const;
|
||||
int GetCurrentMaxSpeed() const override;
|
||||
|
||||
/**
|
||||
* Get the next real (non-articulated part and non rear part of dualheaded engine) vehicle in the consist.
|
||||
|
|
Loading…
Reference in New Issue