20 #ifndef PATHFIND_H_INCLUDED
21 #define PATHFIND_H_INCLUDED
45 const unit* pass_check=
nullptr,
46 const team* shroud_check=
nullptr,
54 team const &viewing_team,
bool see_all=
false);
80 bool force_ignore_zocs,
bool allow_teleport,
81 const team &viewing_team,
int additional_turns = 0,
82 bool see_all =
false,
bool ignore_units =
false);
98 std::vector<map_location>
get_path(
const const_iterator &)
const;
110 const std::map<map_location, int>& jamming_map);
113 const std::map<map_location, int>& jamming_map);
170 mark(
int turns_number = 0,
bool in_zoc =
false,
171 bool do_capture =
false,
bool is_invisible =
false)
195 const size_t parWidth,
const size_t parHeight,
209 bool see_all =
false);
271 bool allow_teleport,
const team &viewing_team,
272 bool see_all=
true,
bool ignore_units=
true);
277 bool allow_teleport,
const team &viewing_team,
278 bool see_all=
true,
bool ignore_units=
true);
283 std::pair<int, int>
get_pair_at(
int x,
int y)
const;
plain_route a_star_search(const map_location &src, const map_location &dst, double stop_at, const cost_calculator *calc, const size_t width, const size_t height, const teleport_map *teleports, bool border)
Stores a set of terrain costs (for movement, vision, or "jamming").
marked_route & operator=(const marked_route &rhs)
marked_route mark_route(const plain_route &rt)
Add marks on a route rt assuming that the unit located at the first hex of rt travels along it...
bool operator==(const mark &m) const
Function which doesn't take anything into account.
std::vector< std::pair< int, int > > cost_map
std::pair< int, int > get_pair_at(int x, int y) const
Accessor for the cost/reach-amount pairs.
emergency_path_calculator(const unit &u, const gamemap &map)
map_location find_vacant_castle(const unit &leader)
Wrapper for find_vacant_tile() when looking for a vacant castle tile near a leader.
virtual double cost(const map_location &loc, const double so_far) const
map_location find_vacant_tile(const map_location &loc, VACANT_TILE_TYPE vacancy, const unit *pass_check, const team *shroud_check, const game_board *board)
Function that will find a location on the board that is as near to loc as possible, but which is unoccupied by any units.
A refinement of paths for use when calculating jamming.
const_iterator find(const map_location &) const
marked_route(const marked_route &rhs)
GLint GLint GLint GLint GLint GLint y
The basic "size" of the unit - flying, small land, large land, etc.
void add_unit(const unit &u, bool use_max_moves=true)
Adds a units cost map to cost_map (increments the elements in cost_map)
virtual ~jamming_path()
Default destructor.
double get_average_cost_at(int x, int y) const
Accessor for the costs.
std::vector< team > const & teams_
static double getNoPathValue()
static std::vector< team > *& teams
bool contains(const map_location &) const
team const & viewing_team_
This class stores all the data for a single 'side' (in game nomenclature).
virtual double cost(const map_location &loc, const double so_far) const
std::vector< map_location > steps
virtual double cost(const map_location &loc, const double so_far) const
bool const ignore_defense_
move_type_path_calculator(const movetype &mt, int movement_left, int total_movement, const team &t, const gamemap &map)
Structure which holds a single route between one location and another.
const bool allow_teleport_
vision_path(const unit &viewer, map_location const &loc, const std::map< map_location, int > &jamming_map)
Construct a list of seen hexes for a unit.
dummy_path_calculator(const unit &u, const gamemap &map)
Encapsulates the map of the game.
virtual ~vision_path()
Default destructor.
Function which only uses terrain, ignoring shroud, enemies, etc.
full_cost_map(const unit &u, bool force_ignore_zoc, bool allow_teleport, const team &viewing_team, bool see_all=true, bool ignore_units=true)
Constructs a cost-map.
Structure which holds a single route and marks for special events.
virtual double cost(const map_location &loc, const double so_far) const
int move_cost
Movement cost for reaching the end of the route.
Encapsulates the map of the game.
virtual ~paths()
Virtual destructor (default processing).
mark(int turns_number=0, bool in_zoc=false, bool do_capture=false, bool is_invisible=false)
Ordered vector of possible destinations.
Structure which uses find_routes() to build a cost map This maps each hex to a the movements a unit w...
const team & viewing_team_
GLint GLint GLint GLint GLint x
shortest_path_calculator(const unit &u, const team &t, const std::vector< team > &teams, const gamemap &map, bool ignore_unit=false, bool ignore_defense_=false, bool see_all=false)
A refinement of paths for use when calculating vision.
const bool force_ignore_zoc_
std::map< map_location, mark > mark_map
GLint GLint GLsizei GLsizei GLsizei GLint border
virtual double cost(const map_location &loc, const double so_far) const =0
int const total_movement_
std::set< map_location > edges
The edges are the non-destination hexes bordering the destinations.
const int total_movement_
Object which contains all the possible locations a unit can move to, with associated best routes to t...
const movetype & movement_type_
int get_cost_at(int x, int y) const
Accessor for the costs.
std::vector< map_location > get_path(const const_iterator &) const
Returns the path going from the source point (included) to the destination point j (excluded)...
team const & viewing_team_
bool enemy_zoc(team const ¤t_team, map_location const &loc, team const &viewing_team, bool see_all)
Determines if a given location is in an enemy zone of control.
std::vector< map_location > & steps
void insert(const map_location &)
virtual ~cost_calculator()
jamming_path(const unit &jammer, map_location const &loc)
Construct a list of jammed hexes for a unit.