OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
21 typedef std::deque<Trackdir> ShipPathCache;
uint32 TileIndex
The index/ID of a Tile.
void PreDestructor()
Destroy all stuff that (still) needs the virtual functions to work properly.
Direction
Defines the 8 directions on the map.
bool Tick()
Calls the tick handler of the vehicle.
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...
int GetDisplaySpeed() const
Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
ShipPathCache path
Cached path.
void PlayLeaveStationSound() const
Play the sound associated with leaving the station.
Ship()
We don't want GCC to zero our struct! It already is zeroed and has an index!
WaterClass GetEffectiveWaterClass(TileIndex tile)
Determine the effective WaterClass for a ship travelling on a tile.
Direction rotation
Visible direction.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
bool IsInDepot() const
Check whether the vehicle is in the depot.
EngineImageType
Visualisation contexts of vehicles and engines.
uint16 cur_speed
current speed
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).
void UpdateCache()
Update the caches of this ship.
bool IsPrimaryVehicle() const
Whether this is the primary vehicle in the chain.
int16 rotation_y_pos
NOSAVE: Y Position before rotation.
uint16 EngineID
Unique identification number of an engine.
ExpensesType GetExpenseType(bool income) const
Sets the expense type associated to this vehicle type.
TileIndex tile
Current tile index.
void MarkDirty()
Marks the vehicles to be redrawn and updates cached variables.
Sprite sequence for a vehicle part.
@ EXPENSES_SHIP_INC
Income from ships.
void OnNewDay()
Calls the new day handler of the vehicle.
Class defining several overloaded accessors so we don't have to cast vehicle types that often.
void GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const
Gets the sprite to show for the given direction.
void UpdateDeltaXY()
Updates the x and y offsets and the size of the sprite used for this vehicle.
virtual ~Ship()
We want to 'destruct' the right class.
Trackdir GetVehicleTrackdir() const
Returns the Trackdir on which the vehicle is currently located.
Direction direction
facing
@ TRACK_BIT_DEPOT
Bitflag for a depot.
VehicleCache vcache
Cache of often used vehicle 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.
uint16 cached_max_speed
Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
TrackBits
Bitfield corresponding to Track.
int16 rotation_x_pos
NOSAVE: X Position before rotation.
bool IsShipDestinationTile(TileIndex tile, StationID station)
Test if a tile is a docking tile for the given station.
Money GetRunningCost() const
Gets the running cost of a vehicle.
Trackdir
Enumeration for tracks and directions.
int GetDisplayMaxSpeed() const
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
ExpensesType
Types of expenses.
@ EXPENSES_SHIP_RUN
Running costs ships.
int GetCurrentMaxSpeed() const
Calculates the maximum speed of the vehicle under its current conditions.