Water region based YAPF implementation for ships.
More...
|
| using | Node = typename WaterRegionTypes::NodeList::Item |
|
| typedef WaterRegionTypes::Tpf | Tpf |
| | the pathfinder class (derived from THIS class)
|
| typedef WaterRegionTypes::TrackFollower | TrackFollower |
| typedef WaterRegionTypes::NodeList | NodeList |
| | our node list
|
| typedef WaterRegionTypes::VehicleType | VehicleType |
| | the type of vehicle
|
| typedef NodeList::Item | Node |
| | this will be our node type
|
| typedef Node::Key | Key |
| | key to hash tables
|
| using | PfFollowNodeFunc |
| | Called by YAPF to move from the given node to the next tile.
|
| using | PfCalcCostFunc |
| | Called by YAPF to calculate the cost from the origin to the given node.
|
| using | PfCalcEstimateFunc |
| | Called by YAPF to calculate cost estimate.
|
| using | PfDetectDestinationFunc |
| | Called by YAPF to detect if node ends in the desired destination.
|
| using | PfDetectDestinationTileFunc |
| | Called by YAPF to detect if node ends in the desired destination.
|
| using | TransportTypeCharFunc |
| | Return debug report character to identify the transportation type.
|
| typedef WaterRegionTypes::Tpf | Tpf |
| | the pathfinder class (derived from THIS class)
|
| typedef WaterRegionTypes::NodeList::Item | Node |
| | this will be our node type
|
| NodeList | nodes |
| | node list multi-container
|
| int | num_steps |
| | this is there for debugging purposes (hope it doesn't hurt)
|
| Tpf & | Yapf () |
| | Access the inherited path finder.
|
| Node * | best_dest_node |
| | pointer to the destination node found at last round
|
| Node * | best_intermediate_node |
| | here should be node closest to the destination if path not found
|
| const YAPFSettings * | settings |
| | current settings (_settings_game.yapf)
|
| int | max_search_nodes |
| | maximum number of nodes we are allowed to visit before we give up
|
| const VehicleType * | vehicle |
| | vehicle that we are trying to drive
|
| int | stats_cost_calcs |
| | stats - how many node's costs were calculated
|
| int | stats_cache_hits |
| | stats - how many node's costs were reused from cache
|
Water region based YAPF implementation for ships.
Definition at line 92 of file yapf_ship_regions.cpp.
◆ Node
| using YapfShipRegions::Node = typename WaterRegionTypes::NodeList::Item |
|
private |
◆ YapfShipRegions()
| YapfShipRegions::YapfShipRegions |
( |
int | max_nodes | ) |
|
|
inlineexplicit |
◆ AddOrigin()
◆ FindWaterRegionPath()
Finds a path at the water region level.
Note that the starting region is always included if the path was found.
- Parameters
-
| v | The ship to find a path for. |
| start_tile | The tile to start searching from. |
| max_returned_path_length | The maximum length of the path that will be returned. |
- Returns
- A path of water region patches, or an empty vector if no path was found.
Definition at line 183 of file yapf_ship_regions.cpp.
References Vehicle::current_order, Vehicle::dest_tile, Dock, CYapfBaseT< Types >::FindPath(), CYapfBaseT< Types >::GetBestNode(), Order::GetDestination(), BaseStation::GetTileArea(), GetWaterRegionPatchInfo(), INVALID_TILE, IsDockingTile(), IsShipDestinationTile(), Order::IsType(), and Map::Size().
Referenced by YapfShipFindWaterRegionPath().
◆ HasOrigin()
◆ PfCalcCost()
| bool YapfShipRegions::PfCalcCost |
( |
Node & | n, |
|
|
const TrackFollower * | follower ) |
|
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.
- Parameters
-
| n | The node to consider. |
| follower | The track follower to the next node. |
- Returns
true iff the costs could be calculated.
Definition at line 152 of file yapf_ship_regions.cpp.
References DIAGDIRDIFF_90LEFT, DIAGDIRDIFF_90RIGHT, and DiagDirDifference().
◆ PfCalcEstimate()
| bool YapfShipRegions::PfCalcEstimate |
( |
Node & | n | ) |
|
|
inline |
Called by YAPF to calculate cost estimate.
Calculates distance to the destination adds it to the actual cost from origin and stores the sum to the Node::estimate.
- Parameters
-
- Returns
true iff the cost could be estimated.
Definition at line 167 of file yapf_ship_regions.cpp.
References PfDetectDestination().
◆ PfDetectDestination()
| bool YapfShipRegions::PfDetectDestination |
( |
Node & | n | ) |
const |
|
inline |
Called by YAPF to detect if node ends in the desired destination.
- Parameters
-
- Returns
true iff the destination has been reached.
Definition at line 146 of file yapf_ship_regions.cpp.
Referenced by PfCalcEstimate().
◆ PfFollowNode()
| void YapfShipRegions::PfFollowNode |
( |
Node & | old_node | ) |
|
|
inline |
◆ SetDestination()
◆ TransportTypeChar()
| char YapfShipRegions::TransportTypeChar |
( |
| ) |
const |
|
inline |
Return debug report character to identify the transportation type.
- Returns
- The debug representation
Definition at line 180 of file yapf_ship_regions.cpp.
◆ Yapf()
◆ dest
◆ origin_keys
The documentation for this class was generated from the following file: