|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
19 typedef std::deque<Trackdir> ShipPathCache;
39 void PlayLeaveStationSound(
bool force =
false)
const override;
51 TileIndex GetOrderStationLocation(StationID station)
override;
Money GetRunningCost() const override
Gets the running cost of a vehicle.
void PreDestructor()
Destroy all stuff that (still) needs the virtual functions to work properly.
bool IsInDepot() const override
Check whether the vehicle is in the depot.
Direction
Defines the 8 directions on the map.
int GetDisplaySpeed() const override
Gets the speed in km-ish/h that can be sent into SetDParam for string processing.
int GetCurrentMaxSpeed() const override
Calculates the maximum speed of the vehicle under its current conditions.
Trackdir GetVehicleTrackdir() const override
Returns the Trackdir on which the vehicle is currently located.
ShipPathCache path
Cached path.
int GetDisplayMaxSpeed() const override
Gets the maximum speed in km-ish/h that can be sent into SetDParam for string processing.
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.
EngineImageType
Visualisation contexts of vehicles and engines.
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.
uint16_t cached_max_speed
Maximum speed of the consist (minimum of the max speed of all vehicles in the consist).
void OnNewEconomyDay() override
Economy day handler.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
TileIndex tile
Current tile index.
Sprite sequence for a vehicle part.
Class defining several overloaded accessors so we don't have to cast vehicle types that often.
uint16_t cur_speed
current speed
ClosestDepot FindClosestDepot() override
Find the closest depot for this vehicle and tell us the location, DestinationID and whether we should...
int16_t rotation_y_pos
NOSAVE: Y Position before rotation.
virtual ~Ship()
We want to 'destruct' the right class.
Direction direction
facing
@ TRACK_BIT_DEPOT
Bitflag for a depot.
VehicleCache vcache
Cache of often used vehicle values.
All ships have this type.
bool IsPrimaryVehicle() const override
Whether this is the primary vehicle in the chain.
void MarkDirty() override
Marks the vehicles to be redrawn and updates cached variables.
bool Tick() override
Calls the tick handler of the vehicle.
TrackBits state
The "track" the ship is following.
Structure to return information about the closest depot location, and whether it could be found.
TrackBits
Allow incrementing of Track variables.
bool IsShipDestinationTile(TileIndex tile, StationID station)
Test if a tile is a docking tile for the given station.
void OnNewCalendarDay() override
Calendar day handler.
void UpdateDeltaXY() override
Updates the x and y offsets and the size of the sprite used for this vehicle.
uint16_t EngineID
Unique identification number of an engine.
Trackdir
Enumeration for tracks and directions.
ExpensesType
Types of expenses.
int16_t rotation_x_pos
NOSAVE: X Position before rotation.
@ EXPENSES_SHIP_RUN
Running costs ships.
@ EXPENSES_SHIP_REVENUE
Revenue from ships.