|
OpenTTD Source 20251117-master-g7398d2e290
|
Base for ships. More...
Go to the source code of this file.
Data Structures | |
| struct | ShipPathElement |
| Element of the ShipPathCache. More... | |
| struct | Ship |
| All ships have this type. More... | |
Typedefs | |
| using | ShipPathCache = std::vector< ShipPathElement > |
Functions | |
| 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. | |
| bool | IsShipDestinationTile (TileIndex tile, StationID station) |
| Test if a tile is a docking tile for the given station. | |
Base for ships.
Definition in file ship.h.
| using ShipPathCache = std::vector<ShipPathElement> |
| WaterClass GetEffectiveWaterClass | ( | TileIndex | tile | ) |
Determine the effective WaterClass for a ship travelling on a tile.
| tile | Tile of interest |
Definition at line 53 of file ship_cmd.cpp.
References GetTunnelBridgeTransportType(), GetWaterClass(), HasTileWaterClass(), IsTileType(), MP_RAILWAY, MP_TUNNELBRIDGE, RAIL_GROUND_WATER, TRANSPORT_WATER, WATER_CLASS_CANAL, and WATER_CLASS_SEA.
Referenced by CYapfCostShipT< Types >::PfCalcCost(), and Ship::UpdateCache().
| 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).
| engine | The engine to get the sprite from. | |
| [out] | width | The width of the sprite. |
| [out] | height | The height of the sprite. |
| [out] | xoffs | Number of pixels to shift the sprite to the right. |
| [out] | yoffs | Number of pixels to shift the sprite downwards. |
| image_type | Context the sprite is used in. |
Definition at line 119 of file ship_cmd.cpp.
References VehicleSpriteSeq::GetBounds(), Rect::Height(), UnScaleGUI(), and Rect::Width().
Referenced by EnginePreviewWindow::UpdateWidgetSize().
Test if a tile is a docking tile for the given station.
| tile | Docking tile to test. |
| station | Destination station. |
Definition at line 617 of file ship_cmd.cpp.
References DIAGDIR_BEGIN, DIAGDIR_END, Industry::GetByTile(), GetStationIndex(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, IsDockingTile(), IsDockTile(), IsDockWaterPart(), IsOilRig(), IsTileType(), IsValidTile(), MP_INDUSTRY, MP_STATION, Industry::neutral_station, and TileOffsByDiagDir().
Referenced by RemoveDock().