|
OpenTTD Source 20260421-master-gc2fbc6fdeb
|
Cost Provider module of YAPF for ships. More...
Public Types | |
| typedef Types::Tpf | Tpf |
| the pathfinder class (derived from THIS class). | |
| typedef Types::TrackFollower | TrackFollower |
| typedef Types::NodeList::Item | Node |
| this will be our node type. | |
| typedef Node::Key | Key |
| key to hash tables. | |
Public Member Functions | |
| Tpf & | Yapf () |
| Access the inherited path finder. | |
| int | CurveCost (Trackdir td1, Trackdir td2) |
| bool | PfCalcCost (Node &n, const TrackFollower *follower) |
| Called by YAPF to calculate the cost from the origin to the given node. | |
Static Public Member Functions | |
| static bool | IsPreferredShipDirection (TileIndex tile, Trackdir td) |
| Whether the provided direction is a preferred direction for a given tile. | |
Cost Provider module of YAPF for ships.
Definition at line 326 of file yapf_ship.cpp.
| typedef Node::Key CYapfCostShipT< Types >::Key |
key to hash tables.
Definition at line 331 of file yapf_ship.cpp.
| typedef Types::NodeList::Item CYapfCostShipT< Types >::Node |
this will be our node type.
Definition at line 330 of file yapf_ship.cpp.
| typedef Types::Tpf CYapfCostShipT< Types >::Tpf |
the pathfinder class (derived from THIS class).
Definition at line 328 of file yapf_ship.cpp.
| typedef Types::TrackFollower CYapfCostShipT< Types >::TrackFollower |
Definition at line 329 of file yapf_ship.cpp.
|
inline |
Definition at line 340 of file yapf_ship.cpp.
|
inlinestatic |
Whether the provided direction is a preferred direction for a given tile.
This is used to separate ships travelling in opposite directions.
Definition at line 361 of file yapf_ship.cpp.
References HasBit(), TileX(), TileY(), TRACKDIR_BIT_LEFT_S, TRACKDIR_BIT_LOWER_E, TRACKDIR_BIT_RIGHT_N, TRACKDIR_BIT_UPPER_W, TRACKDIR_X_NE, TRACKDIR_X_SW, TRACKDIR_Y_NW, and TRACKDIR_Y_SE.
Referenced by PfCalcCost().
|
inline |
Called by YAPF to calculate the cost from the origin to the given node.
Calculates only the cost of given node, adds it to the parent node cost and stores the result into Node::cost member.
| n | The node to consider. |
| follower | The track follower to the next node. |
true iff the costs could be calculated. Definition at line 373 of file yapf_ship.cpp.
References ShipVehicleInfo::ApplyWaterClassSpeedFrac(), ShipVehicleInfo::canal_speed_frac, GetEffectiveWaterClass(), GetLockPart(), IsDiagonalTrackdir(), IsDockingTile(), IsLock(), IsPreferredShipDirection(), IsTileType(), ShipVehicleInfo::max_speed, Middle, ShipVehicleInfo::ocean_speed_frac, Sea, TILE_HEIGHT, Water, Yapf(), YAPF_TILE_CORNER_LENGTH, and YAPF_TILE_LENGTH.
|
inline |
Access the inherited path finder.
Definition at line 334 of file yapf_ship.cpp.
Referenced by PfCalcCost().