diff options
author | rubidium <rubidium@openttd.org> | 2009-05-22 18:17:20 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-05-22 18:17:20 +0000 |
commit | 441011b782294e93b47876f24de96a63da7dd678 (patch) | |
tree | 7592579bbde1a91f353a6d685a8a64128f6a6955 /src/vehicle_base.h | |
parent | cf0cfb908f02ca54efd5956f11909514de062015 (diff) | |
download | openttd-441011b782294e93b47876f24de96a63da7dd678.tar.xz |
(svn r16382) -Codechange: make GetVehicleTrackdir a member function of Vehicle.
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r-- | src/vehicle_base.h | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 6c3d86757..91b5b69b8 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -185,10 +185,6 @@ struct VehicleDisaster { VehicleID big_ufo_destroyer_target; }; -struct VehicleShip { - TrackBitsByte state; -}; - typedef Pool<Vehicle, VehicleID, 512, 64000> VehiclePool; extern VehiclePool _vehicle_pool; @@ -322,7 +318,6 @@ public: VehicleRoad road; VehicleEffect effect; VehicleDisaster disaster; - VehicleShip ship; } u; /* cached oftenly queried NewGRF values */ @@ -438,6 +433,20 @@ public: virtual void OnNewDay() {}; /** + * Returns the Trackdir on which the vehicle is currently located. + * Works for trains and ships. + * Currently works only sortof for road vehicles, since they have a fuzzy + * concept of being "on" a trackdir. Dunno really what it returns for a road + * vehicle that is halfway a tile, never really understood that part. For road + * vehicles that are at the beginning or end of the tile, should just return + * the diagonal trackdir on which they are driving. I _think_. + * For other vehicles types, or vehicles with no clear trackdir (such as those + * in depots), returns 0xFF. + * @return the trackdir of the vehicle + */ + virtual Trackdir GetVehicleTrackdir() const { return INVALID_TRACKDIR; } + + /** * Gets the running cost of a vehicle that can be sent into SetDParam for string processing. * @return the vehicle's running cost */ @@ -663,19 +672,6 @@ static inline Order *GetVehicleOrder(const Vehicle *v, int index) { return (v->o */ static inline Order *GetLastVehicleOrder(const Vehicle *v) { return (v->orders.list == NULL) ? NULL : v->orders.list->GetLastOrder(); } -/** - * Returns the Trackdir on which the vehicle is currently located. - * Works for trains and ships. - * Currently works only sortof for road vehicles, since they have a fuzzy - * concept of being "on" a trackdir. Dunno really what it returns for a road - * vehicle that is halfway a tile, never really understood that part. For road - * vehicles that are at the beginning or end of the tile, should just return - * the diagonal trackdir on which they are driving. I _think_. - * For other vehicles types, or vehicles with no clear trackdir (such as those - * in depots), returns 0xFF. - */ -Trackdir GetVehicleTrackdir(const Vehicle *v); - void CheckVehicle32Day(Vehicle *v); static const int32 INVALID_COORD = 0x7fffffff; |