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