(svn r19339) -Codechange: Move acceleration functions to GroundVehicle.

This commit is contained in:
terkhen
2010-03-06 12:44:30 +00:00
parent e4a5a556b4
commit 07c373d60a
7 changed files with 164 additions and 131 deletions

View File

@@ -110,6 +110,8 @@ struct Train : public GroundVehicle<Train, VEH_TRAIN> {
/** We want to 'destruct' the right class. */
virtual ~Train() { this->PreDestructor(); }
friend struct GroundVehicle<Train, VEH_TRAIN>; // GroundVehicle needs to use the acceleration functions defined at Train.
const char *GetTypeString() const { return "train"; }
void MarkDirty();
void UpdateDeltaXY(Direction direction);
@@ -135,15 +137,12 @@ struct Train : public GroundVehicle<Train, VEH_TRAIN> {
int GetCurveSpeedLimit() const;
void ConsistChanged(bool same_length);
void CargoChanged();
void PowerChanged();
int UpdateSpeed();
void UpdateAcceleration();
int GetCurrentMaxSpeed() const;
int GetAcceleration() const;
/**
* enum to handle train subtypes