20 #ifndef AI_DEFAULT_CONTEXTS_HPP_INCLUDED
21 #define AI_DEFAULT_CONTEXTS_HPP_INCLUDED
34 #pragma warning(disable:4250)
45 (EXPLICIT,
"explicit")
47 (BATTLE_AID,
"battle aid")
89 const move_map& enemy_dstsrc,
double aggression);
98 std::vector<std::pair<map_location,map_location> >
movements;
bool leader_threat
Is true if the unit is a threat to our leader.
virtual default_ai_context & get_default_ai_context()=0
virtual void add_target(const target &t) const
TYPE
UNSCALED : image will be drawn "as is" without changing size, even in case of redraw SCALED_TO_ZOOM :...
double avg_damage_taken
The average hitpoints damage taken.
virtual int rate_terrain(const unit &u, const map_location &loc) const
virtual void add_target(const target &t) const
variant get_value(const std::string &key) const
virtual const std::vector< target > & additional_targets() const =0
recursion_counter recursion_counter_
MAKE_ENUM(TYPE,(VILLAGE,"village")(LEADER,"leader")(EXPLICIT,"explicit")(THREAT,"threat")(BATTLE_AID,"battle aid")(MASS,"mass")(SUPPORT,"support"))
default_ai_context_impl(readwrite_context &context, const config &)
GLuint GLuint GLsizei GLenum type
double avg_damage_inflicted
The average hitpoints damage inflicted.
double vulnerability
The vulnerability is the power projection of enemy units onto the hex we're standing on...
GLuint const GLfloat * val
int count_free_hexes_in_castle(const map_location &loc, std::set< map_location > &checked_hexes)
int count_free_hexes_in_castle(const map_location &loc, std::set< map_location > &checked_hexes)
double resources_used
The sum of the values of units used in the attack.
double chance_to_kill
Estimated % chance to kill the unit.
virtual std::vector< target > find_targets(const move_map &enemy_dstsrc)
int target_starting_damage
double terrain_quality
The weighted average of the % chance to hit each attacking unit.
double target_value
The value of the unit being targeted.
std::multimap< map_location, map_location > move_map
The standard way in which a map of possible moves is recorded.
A small explanation about what's going on here: Each action has access to two game_info objects First...
void analyze(const gamemap &map, unit_map &units, const readonly_context &ai_obj, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc, double aggression)
virtual std::vector< target > find_targets(const move_map &enemy_dstsrc)
virtual const std::vector< target > & additional_targets() const
int get_recursion_count() const
Get the value of the recursion counter.
default_ai_context()
Constructor.
virtual default_ai_context & get_default_ai_context()
double alternative_terrain_quality
The weighted average of the % defense of the best possible terrain that the attacking units could rea...
void get_inputs(std::vector< game_logic::formula_input > *inputs) const
GLsizei const GLfloat * value
bool attack_close(const map_location &loc) const
virtual default_ai_context & get_default_ai_context()
virtual config to_default_ai_context_config() const
Encapsulates the map of the game.
target(const map_location &pos, double val, TYPE target_type=TYPE::VILLAGE)
void init_default_ai_context_proxy(default_ai_context &target)
Encapsulates the map of the game.
bool uses_leader
Is true if this attack sequence makes use of the leader.
virtual int count_free_hexes_in_castle(const map_location &loc, std::set< map_location > &checked_hexes)=0
int get_count() const
Get the current value of the recursion counter.
virtual ~default_ai_context()
Destructor.
std::vector< std::pair< map_location, map_location > > movements
virtual int rate_terrain(const unit &u, const map_location &loc) const
double avg_losses
The value on average, of units lost in the combat.
virtual int rate_terrain(const unit &u, const map_location &loc) const =0
virtual config to_default_ai_context_config() const
Helper functions for the object which operates in the context of AI for specific side this is part of...
virtual ~default_ai_context_proxy()
virtual void clear_additional_targets() const =0
default_ai_context * target_
virtual void clear_additional_targets() const
Container associating units to locations.
bool is_surrounded
Is true if the units involved in this attack sequence are surrounded.
void init_readwrite_context_proxy(readwrite_context &target)
virtual void clear_additional_targets() const
std::vector< target > additional_targets_
A config object defines a single node in a WML file, with access to child nodes.
virtual config to_default_ai_context_config() const =0
virtual ~default_ai_context_impl()
Defines the MAKE_ENUM macro.
GLsizei const GLcharARB ** string
virtual std::vector< target > find_targets(const move_map &enemy_dstsrc)=0
virtual const std::vector< target > & additional_targets() const
virtual void add_target(const target &t) const =0
double rating(double aggression, const readonly_context &ai_obj) const
default_ai_context_proxy()