21 typedef std::deque<Trackdir> ShipPathCache;
int GetDisplayMaxSpeed() const
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
Direction direction
facing
ShipPathCache path
Cached path.
void PlayLeaveStationSound() const
Play the sound associated with leaving the station.
bool Tick()
Calls the tick handler of the vehicle.
Trackdir
Enumeration for tracks and directions.
uint16 cur_speed
current speed
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.
Direction rotation
Visible direction.
int16 rotation_y_pos
NOSAVE: Y Position before rotation.
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.
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 UpdateDeltaXY()
Updates the x and y offsets and the size of the sprite used for this vehicle.
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.
Direction
Defines the 8 directions on the map.
TrackBits
Bitfield corresponding to Track.
TileIndex tile
Current tile index.
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.
bool IsShipDestinationTile(TileIndex tile, StationID station)
Test if a tile is a docking tile for the given station.
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.
TrackBits state
The "track" the ship is following.
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...
ExpensesType
Types of expenses.
Money GetRunningCost() const
Gets the running cost of a vehicle.
int16 rotation_x_pos
NOSAVE: X Position before rotation.
Ship()
We don't want GCC to zero our struct! It already is zeroed and has an index!