(svn r16382) -Codechange: make GetVehicleTrackdir a member function of Vehicle.

This commit is contained in:
rubidium
2009-05-22 18:17:20 +00:00
parent cf0cfb908f
commit 441011b782
16 changed files with 126 additions and 110 deletions

View File

@@ -23,6 +23,8 @@ void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
* As side-effect the vehicle type is set correctly.
*/
struct Ship: public Vehicle {
TrackBitsByte state;
/** Initializes the Vehicle to a ship */
Ship() { this->type = VEH_SHIP; }
@@ -39,9 +41,10 @@ struct Ship: public Vehicle {
int GetDisplaySpeed() const { return this->cur_speed / 2; }
int GetDisplayMaxSpeed() const { return this->max_speed / 2; }
Money GetRunningCost() const;
bool IsInDepot() const { return this->u.ship.state == TRACK_BIT_DEPOT; }
bool IsInDepot() const { return this->state == TRACK_BIT_DEPOT; }
bool Tick();
void OnNewDay();
Trackdir GetVehicleTrackdir() const;
TileIndex GetOrderStationLocation(StationID station);
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
};