![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Collaboration diagram for freeciv::path_finder::path_finder_private:Public Member Functions | |
| path_finder_private (const unit *unit, const detail::vertex &init) | |
| Constructor. More... | |
| ~path_finder_private ()=default | |
| void | insert_initial_vertex () |
| Inserts the initial vertex, from which the search will be started. More... | |
| void | maybe_insert_vertex (const detail::vertex &v) |
| Saves a new vertex for further processing if it is better than the current vertex at the same location. More... | |
| bool | is_reached (const destination &destination, const detail::vertex &v) const |
| Checks if a vertex is at the destination, taking waypoints into account. More... | |
| void | attempt_move (detail::vertex &source) |
| Opens vertices corresponding to attempts to do ORDER_MOVE from the source vertex. More... | |
| void | attempt_full_mp (detail::vertex &source) |
| Opens vertices corresponding to attempts to do ORDER_FULL_MP from the source vertex. More... | |
| void | attempt_load (detail::vertex &source) |
| Opens vertices corresponding to attempts to load into a transport from the source vertex. More... | |
| void | attempt_unload (detail::vertex &source) |
| Opens vertices corresponding to attempts to unload from a transport at the source vertex. More... | |
| void | attempt_paradrop (detail::vertex &source) |
| Opens vertices corresponding to attempts to unload from a transport at the source vertex. More... | |
| void | attempt_action_move (detail::vertex &source) |
| Opens vertices corresponding to attempts to do ORDER_ACTION_MOVE from the source vertex. More... | |
| bool | run_search (const destination &destination, bool full=false) |
| Runs the path finding seach until the stopping condition is met (the destination tile is reached). More... | |
| void | reset () |
| Resets the state of the path finder. More... | |
Public Attributes | |
| const ::unit | unit |
| A unit used to probe whether moves are valid. More... | |
| const detail::vertex | initial_vertex |
| The starting point in the search graph. More... | |
| std::unique_ptr< step_constraint > | constraint = nullptr |
| storage_type | best_vertices |
| std::priority_queue< detail::vertex, std::vector< detail::vertex >, std::greater<> > | queue |
| std::vector< const tile * > | waypoints |
Definition at line 66 of file path_finder.h.
|
explicit |
Constructor.
Definition at line 145 of file path_finder.cpp.
|
default |
| void freeciv::path_finder::path_finder_private::attempt_action_move | ( | detail::vertex & | source | ) |
Opens vertices corresponding to attempts to do ORDER_ACTION_MOVE from the source vertex.
The generated vertices are always final because ORDER_ACTION_MOVE cannot be used in the middle of a path.
Definition at line 514 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::attempt_full_mp | ( | detail::vertex & | source | ) |
Opens vertices corresponding to attempts to do ORDER_FULL_MP from the source vertex.
This is a last resort vertex that may give the unit more HP or fuel that will be useful to continue its journey.
Definition at line 323 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::attempt_load | ( | detail::vertex & | source | ) |
Opens vertices corresponding to attempts to load into a transport from the source vertex.
Definition at line 337 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::attempt_move | ( | detail::vertex & | source | ) |
Opens vertices corresponding to attempts to do ORDER_MOVE from the source vertex.
Definition at line 276 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::attempt_paradrop | ( | detail::vertex & | source | ) |
Opens vertices corresponding to attempts to unload from a transport at the source vertex.
Definition at line 433 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::attempt_unload | ( | detail::vertex & | source | ) |
Opens vertices corresponding to attempts to unload from a transport at the source vertex.
Definition at line 382 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::insert_initial_vertex | ( | ) |
Inserts the initial vertex, from which the search will be started.
Definition at line 155 of file path_finder.cpp.
Referenced by path_finder_private().
| bool freeciv::path_finder::path_finder_private::is_reached | ( | const destination & | destination, |
| const detail::vertex & | v | ||
| ) | const |
Checks if a vertex is at the destination, taking waypoints into account.
Definition at line 256 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::maybe_insert_vertex | ( | const detail::vertex & | v | ) |
Saves a new vertex for further processing if it is better than the current vertex at the same location.
Definition at line 164 of file path_finder.cpp.
| void freeciv::path_finder::path_finder_private::reset | ( | ) |
Resets the state of the path finder.
The search will be resumed from the beginning.
Definition at line 631 of file path_finder.cpp.
| bool freeciv::path_finder::path_finder_private::run_search | ( | const destination & | destination, |
| bool | full = false |
||
| ) |
Runs the path finding seach until the stopping condition is met (the destination tile is reached).
Checks if the tile has already been reached before proceeding.
If full is true, the algorithm is only stopped once all possibilities have been found.
Definition at line 574 of file path_finder.cpp.
| storage_type freeciv::path_finder::path_finder_private::best_vertices |
Definition at line 86 of file path_finder.h.
| std::unique_ptr<step_constraint> freeciv::path_finder::path_finder_private::constraint = nullptr |
Definition at line 76 of file path_finder.h.
| const detail::vertex freeciv::path_finder::path_finder_private::initial_vertex |
The starting point in the search graph.
Definition at line 74 of file path_finder.h.
| std::priority_queue<detail::vertex, std::vector<detail::vertex>, std::greater<> > freeciv::path_finder::path_finder_private::queue |
Definition at line 89 of file path_finder.h.
| const ::unit freeciv::path_finder::path_finder_private::unit |
A unit used to probe whether moves are valid.
Definition at line 72 of file path_finder.h.
| std::vector<const tile *> freeciv::path_finder::path_finder_private::waypoints |
Definition at line 92 of file path_finder.h.