lib Path Finder/ Docs/ Headers/astar/directors.h

directors.h

Directors are objects that finds coordinates adjecent to one-another.

Three templates are defined with movements, so far:

All these templates takes as a parameter, the coordinate type used.

The cool thing about using a template typename to define how to find adjecent coordinates is that we should be able to use the same A-star algorithm with e.g.:

The template only needs to define one method:

    std::vector < coordinate < coord_type > > adjecent ( coord_type x, coord_type y );

And a constructor that takes the map-borders as parameters:

    grid_8_direction ( coord_type origin_x, coord_type origin_y, coord_type size_x, coord_type size_y );

A director can inherit from director_base < coord_type >, to be a bit easier to define.

See code and Directors for more details.

libPathFinder/Docs/Headers/astar/directors.h (last edited 2009-02-01 19:52:04 by RasmusToftdahlOlesen)