47 const unit* pass_check=
nullptr,
48 const team* shroud_check=
nullptr,
55 const team& viewing_team,
bool see_all=
false);
81 bool force_ignore_zocs,
bool allow_teleport,
82 const team &viewing_team,
int additional_turns = 0,
83 bool see_all =
false,
bool ignore_units =
false);
99 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 std::size_t parWidth,
const std::size_t parHeight,
196 const teleport_map* teleports =
nullptr,
bool border =
false);
207 const std::vector<team> &teams,
const gamemap &map,
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);
Encapsulates the map of the game.
A const-only interface for how many (movement, vision, or "jamming") points a unit needs for each hex...
The basic "size" of the unit - flying, small land, large land, etc.
This class stores all the data for a single 'side' (in game nomenclature).
A single unit type that the player may recruit.
This class represents a single unit of a specific type.
map_location find_vacant_castle(const unit &leader)
Wrapper for find_vacant_tile() when looking for a vacant castle tile near a leader.
plain_route a_star_search(const map_location &src, const map_location &dst, double stop_at, const cost_calculator &calc, const std::size_t width, const std::size_t height, const teleport_map *teleports, bool border)
bool enemy_zoc(const team ¤t_team, const map_location &loc, const team &viewing_team, bool see_all)
Determines if a given location is in an enemy zone of control.
marked_route mark_route(const plain_route &rt, bool update_move_cost)
Add marks on a route rt assuming that the unit located at the first hex of rt travels along it.
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,...
rect dst
Location on the final composed sheet.
rect src
Non-transparent portion of the surface to compose.
Encapsulates the map of the game.
static double getNoPathValue()
virtual double cost(const map_location &loc, const double so_far) const =0
virtual ~cost_calculator()
Function which doesn't take anything into account.
virtual double cost(const map_location &loc, const double so_far) const
dummy_path_calculator(const unit &u, const gamemap &map)
Function which only uses terrain, ignoring shroud, enemies, etc.
emergency_path_calculator(const unit &u, const gamemap &map)
virtual double cost(const map_location &loc, const double so_far) const
Structure which uses find_routes() to build a cost map This maps each hex to a the movements a unit w...
const bool force_ignore_zoc_
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.
double get_average_cost_at(map_location loc) const
Accessor for the costs.
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)
const team & viewing_team_
int get_cost_at(map_location loc) const
Accessor for the costs.
std::pair< int, int > get_pair_at(map_location loc) const
Accessor for the cost/reach-amount pairs.
std::vector< std::pair< int, int > > cost_map
const bool allow_teleport_
A refinement of paths for use when calculating jamming.
jamming_path(const unit &jammer, const map_location &loc)
Construct a list of jammed hexes for a unit.
virtual ~jamming_path()
Default destructor.
mark(int turns_number=0, bool in_zoc=false, bool do_capture=false, bool is_invisible=false)
bool operator==(const mark &m) const
Structure which holds a single route and marks for special events.
marked_route(const marked_route &rhs)
marked_route & operator=(const marked_route &rhs)
std::map< map_location, mark > mark_map
std::vector< map_location > & steps
virtual double cost(const map_location &loc, const double so_far) const
move_type_path_calculator(const movetype &mt, int movement_left, int total_movement, const team &t, const gamemap &map)
const int total_movement_
const team & viewing_team_
const movetype & movement_type_
Ordered vector of possible destinations.
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).
void insert(const map_location &)
bool contains(const map_location &) const
const_iterator find(const map_location &) const
Object which contains all the possible locations a unit can move to, with associated best routes to t...
virtual ~paths()
Virtual destructor (default processing).
Structure which holds a single route between one location and another.
std::vector< map_location > steps
int move_cost
Movement cost for reaching the end of the route.
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)
bool const ignore_defense_
const std::vector< team > & teams_
const int total_movement_
virtual double cost(const map_location &loc, const double so_far) const
const team & viewing_team_
A refinement of paths for use when calculating vision.
std::set< map_location > edges
The edges are the non-destination hexes bordering the destinations.
virtual ~vision_path()
Default destructor.
vision_path(const unit &viewer, const map_location &loc, const std::map< map_location, int > &jamming_map)
Constructs a list of vision paths for a unit.