55 #define FOR_ALL_SHIPS(var) FOR_ALL_VEHICLES_OF_TYPE(Ship, var) int GetDisplayMaxSpeed() const
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
DirectionByte direction
facing
void PlayLeaveStationSound() const
Play the sound associated with leaving the station.
bool Tick()
Calls the tick handler of the vehicle.
uint16 cur_speed
current speed
void UpdateDeltaXY(Direction direction)
Updates the x and y offsets and the size of the sprite used for this vehicle.
bool IsInDepot() const
Check whether the vehicle is in the depot.
bool IsPrimaryVehicle() const
Whether this is the primary vehicle in the chain.
int GetDisplaySpeed() const
Gets the speed in km-ish/h that can be sent into SetDParam for string processing. ...
void PreDestructor()
Destroy all stuff that (still) needs the virtual functions to work properly.
TrackBitsByte state
The "track" the ship is following.
EngineImageType
Visualisation contexts of vehicles and engines.
uint16 cached_max_speed
Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
void OnNewDay()
Calls the new day handler of the vehicle.
Direction
Defines the 8 directions on the map.
ExpensesType GetExpenseType(bool income) const
Sets the expense type associated to this vehicle type.
virtual ~Ship()
We want to 'destruct' the right class.
Class defining several overloaded accessors so we don't have to cast vehicle types that often...
void UpdateCache()
Update the caches of this ship.
void MarkDirty()
Marks the vehicles to be redrawn and updates cached variables.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
Map accessors for water tiles.
Trackdir
Enumeration for tracks and directions.
ExpensesType
Types of expenses.
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.
Sprite sequence for a vehicle part.
static T min(const T a, const T b)
Returns the minimum of two values.
All ships have this type.
TileIndex GetOrderStationLocation(StationID station)
Determine the location for the station where the vehicle goes to next.
Base class for all vehicles.
uint16 EngineID
Unique identification number of an engine.
uint32 TileIndex
The index/ID of a Tile.
Trackdir GetVehicleTrackdir() const
Returns the Trackdir on which the vehicle is currently located.
int GetCurrentMaxSpeed() const
Calculates the maximum speed of the vehicle under its current conditions.
void GetShipSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, int &yoffs, EngineImageType image_type)
Get the size of the sprite of a ship sprite heading west (used for lists).
VehicleCache vcache
Cache of often used vehicle values.
WaterClass GetEffectiveWaterClass(TileIndex tile)
Determine the effective WaterClass for a ship travelling on a tile.
bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should...
Money GetRunningCost() const
Gets the running cost of a vehicle.
Ship()
We don't want GCC to zero our struct! It already is zeroed and has an index!