Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

path_finding Namespace Reference


Classes

struct  frontier_node
struct  int_pair_and_cost
struct  no_route_found

Functions

list< int_pair_and_costneighbours (int_pair node)
float distance (int_pair p1, int_pair p2)
bool compare_frontier_nodes (const frontier_node &f1, const frontier_node &f2)
bool int_pair__equal (int_pair p1, int_pair p2)
string string_of_int_pair (int_pair p)
variant< no_route_found, pt<
list< int_pair > > > 
best_route (int_pair from, int_pair to, const vector2< bool > &walkable)


Function Documentation

variant<no_route_found, pt<list<int_pair> > > best_route int_pair  from,
int_pair  to,
const vector2< bool > &  walkable
 

uses the A* algorithm. The returned route never contains the "from" point, and is empty if "from" == "to".

Definition at line 1158 of file fack.cc.

References compare_frontier_nodes(), path_finding::frontier_node::cost_g, distance(), vector2< T >::fill_with(), foreach, vector2< T >::get(), int_pair__equal(), neighbours(), NEW, path_finding::frontier_node::position, vector2< T >::set(), setof, setof_, int_pair::x, and int_pair::y.

Referenced by FACK::exec_next_scr_cmd().

bool compare_frontier_nodes const frontier_node &  f1,
const frontier_node &  f2
 

Definition at line 1135 of file fack.cc.

Referenced by best_route().

float distance int_pair  p1,
int_pair  p2
 

Definition at line 1123 of file fack.cc.

References int_pair::x, and int_pair::y.

Referenced by best_route().

bool int_pair__equal int_pair  p1,
int_pair  p2
 

Definition at line 1142 of file fack.cc.

References int_pair::x, and int_pair::y.

Referenced by best_route().

list<int_pair_and_cost> neighbours int_pair  node  ) 
 

Definition at line 1105 of file fack.cc.

References int_pair::x, and int_pair::y.

Referenced by best_route().

string string_of_int_pair int_pair  p  ) 
 

Definition at line 1146 of file fack.cc.

References string_of_int(), int_pair::x, and int_pair::y.


Generated on Wed May 25 15:36:14 2005 for FACK by  doxygen 1.4.0