27using ShipPathCache = std::vector<ShipPathElement>;
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.
Element of the ShipPathCache.
Trackdir trackdir
Trackdir for this element.
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.
TileIndex GetOrderStationLocation(StationID station) override
Determine the location for the station where the vehicle goes to next.
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!
void PlayLeaveStationSound(bool force=false) const override
Play the sound associated with leaving the station.
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 GetImage(Direction direction, EngineImageType image_type, VehicleSpriteSeq *result) const override
Gets the sprite to show for the given direction.
void UpdateCache()
Update the caches of this ship.
ExpensesType GetExpenseType(bool income) const override
Sets the expense type associated to this vehicle type.
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.
@ INVALID_TRACKDIR
Flag for an invalid trackdir.
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).