21 #ifndef AI_CONTEXTS_HPP_INCLUDED
22 #define AI_CONTEXTS_HPP_INCLUDED
46 namespace ai {
class ai_context; }
47 namespace ai {
class unit_advancements_aspect; }
48 namespace ai {
template <
typename T>
class typesafe_aspect; }
56 #pragma warning(disable:4250)
125 const std::set<map_location>&
get();
183 class readonly_context;
201 bool assume_full_movement=
false,
204 std::map<map_location,pathfind::paths>& possible_moves,
move_map& srcdst,
205 move_map& dstsrc,
bool enemy,
bool assume_full_movement=
false,
207 bool see_all=
false)
const = 0;
238 virtual void add_aspects(std::vector< aspect_ptr > &aspects ) = 0;
270 virtual const std::vector<engine_ptr>&
get_engines()
const = 0;
273 virtual std::vector<engine_ptr>&
get_engines() = 0;
279 virtual const std::vector<goal_ptr>&
get_goals()
const = 0;
282 virtual std::vector<goal_ptr>&
get_goals() = 0;
365 virtual const std::set<map_location>&
keeps()
const= 0;
410 typedef std::map<std::pair<map_location,const unit_type *>,
411 std::pair<battle_context_unit_stats,battle_context_unit_stats> >
590 bool assume_full_movement=
false,
597 std::map<map_location,pathfind::paths>& possible_moves,
move_map& srcdst,
598 move_map& dstsrc,
bool enemy,
bool assume_full_movement=
false,
600 bool see_all=
false)
const
602 target_->
calculate_moves(units, possible_moves, srcdst, dstsrc, enemy, assume_full_movement, remove_destinations, see_all);
934 virtual const std::set<map_location>&
keeps()
const
1282 bool assume_full_movement=
false,
1293 std::map<map_location,pathfind::paths>& possible_moves,
move_map& srcdst,
1294 move_map& dstsrc,
bool enemy,
bool assume_full_movement=
false,
1296 bool see_all=
false)
const;
1363 virtual const std::vector<engine_ptr>&
get_engines()
const;
1372 virtual const std::vector<goal_ptr>&
get_goals()
const;
1375 virtual std::vector<goal_ptr>&
get_goals();
1457 virtual const std::set<map_location>&
keeps()
const;
1475 virtual void add_aspects(std::vector< aspect_ptr > &aspects);
1500 template<
typename T>
1687 #pragma warning(pop)
aspect_type< std::string >::typesafe_ptr grouping_
virtual side_number get_side() const
Get the side number.
virtual void invalidate_defensive_position_cache() const
virtual int get_attack_depth() const
virtual void set_dst_src_valid_lua()
moves_map possible_moves_
side_context_impl(side_number side, const config &)
virtual const move_map & get_srcdst() const =0
bool is_ok() const
Check if more recursion is allowed.
virtual config get_leader_goal() const
virtual void invalidate_keeps_cache() const
virtual void set_src_dst_enemy_valid_lua()=0
virtual recall_result_ptr execute_recall_action(const std::string &id, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())=0
virtual bool is_src_dst_valid_lua() const =0
virtual void set_side(side_number side)=0
Set the side number.
virtual config get_leader_goal() const
stopunit_result_ptr check_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)
Check if it is possible to remove unit movements and/or attack.
virtual recruit_result_ptr execute_recruit_action(const std::string &unit_name, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())=0
virtual const moves_map & get_possible_moves() const =0
virtual const aspect_map & get_aspects() const =0
virtual side_context & get_side_context()
unwrap
virtual void set_src_dst_valid_lua()=0
virtual void add_aspects(std::vector< aspect_ptr > &aspects)
virtual void raise_user_interact() const
virtual void invalidate_defensive_position_cache() const =0
attack_result_ptr check_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)
Check if it is possible to attack enemy defender using our unit attacker from attackers current locat...
void init(const gamemap &map)
virtual const std::vector< unit_ptr > & get_recall_list() const =0
virtual bool leader_can_reach_keep() const =0
virtual double get_caution() const
virtual side_context & get_side_context()
unwrap
virtual double get_recruitment_diversity() const =0
virtual recall_result_ptr check_recall_action(const std::string &id, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())=0
virtual move_result_ptr execute_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false)
Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial mov...
virtual ~readwrite_context()
virtual stopunit_result_ptr check_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)=0
virtual std::string get_grouping() const =0
virtual recruit_result_ptr check_recruit_action(const std::string &unit_name, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
virtual attack_result_ptr execute_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)
virtual move_result_ptr check_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false)=0
virtual config to_readwrite_context_config() const =0
serialize this context to config
virtual void set_src_dst_enemy_valid_lua()
virtual const config get_recruitment_instructions() const
virtual void diagnostic(const std::string &msg)=0
virtual const std::set< map_location > & keeps() const
void calculate_possible_moves(std::map< map_location, pathfind::paths > &possible_moves, move_map &srcdst, move_map &dstsrc, bool enemy, bool assume_full_movement=false, const terrain_filter *remove_destinations=nullptr) const
Calculate the moves units may possibly make.
virtual bool get_passive_leader_shares_keep() const
virtual const std::vector< std::string > get_recruitment_more() const
virtual config get_leader_goal() const =0
virtual double get_leader_value() const
virtual const map_location & suitable_keep(const map_location &leader_location, const pathfind::paths &leader_paths)=0
get most suitable keep for leader - nearest free that can be reached in 1 turn, if none - return near...
virtual synced_command_result_ptr execute_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())=0
std::map< map_location, pathfind::paths > moves_map
The standard way in which a map of possible movement routes to location is recorded.
virtual attack_result_ptr execute_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)
Ask the game to attack an enemy defender using our unit attacker from attackers current location...
aspect_type< double >::typesafe_ptr recruitment_diversity_
virtual int get_recursion_count() const
Get the value of the recursion counter.
virtual config to_readwrite_context_config() const
serialize this context to config
virtual void calculate_possible_moves(std::map< map_location, pathfind::paths > &possible_moves, move_map &srcdst, move_map &dstsrc, bool enemy, bool assume_full_movement=false, const terrain_filter *remove_destinations=nullptr) const =0
virtual team & current_team_w()
virtual std::vector< goal_ptr > & get_goals()
virtual bool is_dst_src_enemy_valid_lua() const =0
virtual void calculate_moves(const unit_map &units, std::map< map_location, pathfind::paths > &possible_moves, move_map &srcdst, move_map &dstsrc, bool enemy, bool assume_full_movement=false, const terrain_filter *remove_destinations=nullptr, bool see_all=false) const
virtual bool is_active(const std::string &time_of_day, const std::string &turns) const =0
virtual double get_aggression() const
aspect_type< terrain_filter >::typesafe_ptr avoid_
virtual const map_location & nearest_keep(const map_location &loc) const =0
unit_stats_cache_t unit_stats_cache_
readonly_context_impl(side_context &context, const config &cfg)
Constructor.
virtual bool leader_can_reach_keep() const
aspect_type< config >::typesafe_ptr recruitment_save_gold_
virtual std::string get_grouping() const
aspect_type< double >::typesafe_ptr village_value_
virtual synced_command_result_ptr check_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())=0
synced_command_result_ptr check_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())
Check if it is possible to run Lua code.
readwrite_context_impl(readonly_context &context, const config &)
Constructor.
virtual void add_facet(const std::string &id, const config &cfg) const
virtual void recalculate_move_maps() const
virtual void set_dst_src_valid_lua()=0
virtual bool get_simple_targeting() const =0
bool move_maps_enemy_valid_
virtual bool get_support_villages() const =0
virtual void invalidate_move_maps() const
virtual config to_side_context_config() const
serialize this context to config
virtual const move_map & get_enemy_dstsrc() const =0
virtual unit_stats_cache_t & unit_stats_cache() const
std::vector< goal_ptr > goals_
virtual config to_side_context_config() const =0
serialize this context to config
virtual ~side_context_proxy()
void init_side_context_proxy(side_context &target)
virtual unit_stats_cache_t & unit_stats_cache() const
Weapon choice cache, to speed simulations.
virtual const move_map & get_enemy_srcdst() const
virtual const move_map & get_enemy_srcdst() const =0
virtual double get_village_value() const =0
readwrite_context * target_
static config unit_name(const unit *u)
virtual const attacks_vector & get_attacks() const =0
virtual const std::vector< goal_ptr > & get_goals() const
virtual const map_location & nearest_keep(const map_location &loc) const
virtual int get_villages_per_scout() const
virtual bool leader_can_reach_keep() const
virtual const variant & get_attacks_as_variant() const =0
virtual readwrite_context & get_readwrite_context()
aspect_type< double >::typesafe_ptr scout_village_targeting_
Definitions for the interface to Wesnoth Markup Language (WML).
virtual void invalidate_keeps_cache() const =0
virtual const attacks_vector & get_attacks() const
virtual void invalidate_defensive_position_cache() const
virtual attack_result_ptr check_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)=0
virtual void log_message(const std::string &msg)
virtual const map_location & nearest_keep(const map_location &loc) const
std::map< map_location, defensive_position > defensive_position_cache_
virtual stopunit_result_ptr execute_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)=0
aspect_type< bool >::typesafe_ptr simple_targeting_
virtual const std::set< map_location > & keeps() const
virtual bool get_passive_leader() const =0
virtual double get_leader_aggression() const
virtual config to_readonly_context_config() const =0
serialize to config
virtual bool is_dst_src_enemy_valid_lua() const
virtual const unit_advancements_aspect & get_advancements() const =0
virtual bool get_passive_leader() const
virtual double power_projection(const map_location &loc, const move_map &dstsrc) const
Function which finds how much 'power' a side can attack a certain location with.
virtual const moves_map & get_enemy_possible_moves() const
virtual const std::vector< unit_ptr > & get_recall_list() const
static const int MAX_COUNTER_VALUE
std::vector< attack_analysis > attacks_vector
virtual void set_dst_src_enemy_valid_lua()
virtual ~readonly_context()
virtual double get_scout_village_targeting() const
Object which defines a time of day with associated bonuses, image, sounds etc.
std::map< std::string, known_aspect_ptr > known_aspect_map
std::multimap< map_location, map_location > move_map
The standard way in which a map of possible moves is recorded.
virtual ~readonly_context_proxy()
virtual void set_side(side_number side)
Set the side number.
virtual const unit_advancements_aspect & get_advancements() const
virtual int get_recursion_count() const
Get the value of the recursion counter.
This class stores all the data for a single 'side' (in game nomenclature).
A small explanation about what's going on here: Each action has access to two game_info objects First...
virtual double get_aggression() const
virtual const moves_map & get_possible_moves() const
virtual int get_recursion_count() const =0
Get the value of the recursion counter.
side_context()
empty constructor
virtual const std::vector< unit_ptr > & get_recall_list() const
void raise_user_interact() const
Function which should be called frequently to allow the user to interact with the interface...
recursion_counter(int counter)
virtual bool is_src_dst_enemy_valid_lua() const
virtual void on_readonly_context_create()
aspect_type< bool >::typesafe_ptr passive_leader_
virtual std::map< map_location, defensive_position > & defensive_position_cache() const
virtual bool is_dst_src_valid_lua() const
virtual void set_dst_src_valid_lua()
virtual double get_leader_aggression() const
virtual const terrain_filter & get_avoid() const =0
virtual void add_aspects(std::vector< aspect_ptr > &aspects)=0
virtual int get_attack_depth() const
virtual void on_readonly_context_create()=0
virtual unit_stats_cache_t & unit_stats_cache() const =0
aspect_type< double >::typesafe_ptr aggression_
virtual readwrite_context & get_readwrite_context()=0
virtual synced_command_result_ptr execute_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())
virtual engine_ptr get_engine_by_cfg(const config &cfg)
get engine by cfg, creating it if it is not created yet but known
virtual const game_info & get_info() const =0
virtual ~readonly_context_impl()
Destructor.
virtual const variant & get_attacks_as_variant() const
virtual move_result_ptr check_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false)
aspect_type< int >::typesafe_ptr attack_depth_
virtual const move_map & get_enemy_dstsrc() const
Encapsulates the map of the game.
virtual config to_readwrite_context_config() const
serialize this context to config
moves_map enemy_possible_moves_
virtual void add_aspects(std::vector< aspect_ptr > &aspects)
readonly_context * target_
virtual bool get_leader_ignores_keep() const
virtual void set_side(side_number side)
Set the side number.
bool dst_src_enemy_valid_lua_
aspect_type< bool >::typesafe_ptr passive_leader_shares_keep_
virtual ~readwrite_context_impl()
virtual bool get_leader_ignores_keep() const
virtual const move_map & get_dstsrc() const
defensive_position const & best_defensive_position(const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const
virtual void recalculate_move_maps_enemy() const
void log_message(const std::string &msg)
Display a debug message as a chat message.
virtual std::map< map_location, defensive_position > & defensive_position_cache() const
virtual const std::vector< engine_ptr > & get_engines() const
virtual int get_villages_per_scout() const =0
virtual bool is_dst_src_enemy_valid_lua() const
virtual const move_map & get_srcdst() const
virtual game_info & get_info_w()
Functions to retrieve the 'info' object.
virtual void invalidate_move_maps() const
Structure describing the statistics of a unit involved in the battle.
virtual double power_projection(const map_location &loc, const move_map &dstsrc) const =0
Function which finds how much 'power' a side can attack a certain location with.
virtual bool get_passive_leader_shares_keep() const
virtual synced_command_result_ptr check_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())
virtual const map_location & suitable_keep(const map_location &leader_location, const pathfind::paths &leader_paths)
get most suitable keep for leader - nearest free that can be reached in 1 turn, if none - return near...
virtual void calculate_possible_moves(std::map< map_location, pathfind::paths > &possible_moves, move_map &srcdst, move_map &dstsrc, bool enemy, bool assume_full_movement=false, const terrain_filter *remove_destinations=nullptr) const
virtual game_info & get_info_w()=0
void add_known_aspect(const std::string &name, boost::shared_ptr< typesafe_aspect< T > > &where)
static const map_location & null_location()
virtual bool get_support_villages() const
virtual const game_info & get_info() const
virtual const config get_recruitment_instructions() const =0
Error used for any general game error, e.g.
virtual int get_recruitment_randomness() const
virtual attack_result_ptr execute_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)=0
virtual const terrain_filter & get_avoid() const
std::set< map_location > keeps_
virtual side_context & get_side_context()=0
unwrap
virtual const move_map & get_enemy_dstsrc() const
recursion_counter recursion_counter_
virtual const moves_map & get_possible_moves() const
virtual const move_map & get_enemy_srcdst() const
virtual recall_result_ptr execute_recall_action(const std::string &id, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
aspect_type< config >::typesafe_ptr leader_goal_
virtual double get_recruitment_diversity() const
virtual engine_ptr get_engine_by_cfg(const config &cfg)=0
get engine by cfg, creating it if it is not created yet but known
virtual ~side_context()
empty destructor
virtual bool get_simple_targeting() const
virtual bool is_active(const std::string &time_of_day, const std::string &turns) const
Encapsulates the map of the game.
virtual bool is_active(const std::string &time_of_day, const std::string &turns) const
virtual const config get_recruitment_instructions() const
virtual const config get_recruitment_save_gold() const
virtual std::vector< engine_ptr > & get_engines()
virtual readonly_context & get_readonly_context()
virtual void raise_gamestate_changed() const =0
virtual void log_message(const std::string &msg)=0
virtual double get_recruitment_diversity() const
aspect_type< bool >::typesafe_ptr support_villages_
virtual int get_recursion_count() const
Get the value of the recursion counter.
virtual const map_location & suitable_keep(const map_location &leader_location, const pathfind::paths &leader_paths)
get most suitable keep for leader - nearest free that can be reached in 1 turn, if none - return near...
std::vector< engine_ptr > engines_
AI Support Engines.
aspect_type< int >::typesafe_ptr recruitment_randomness_
virtual bool get_support_villages() const
int get_count() const
Get the current value of the recursion counter.
void diagnostic(const std::string &msg)
Show a diagnostic message on the screen.
virtual recruit_result_ptr execute_recruit_action(const std::string &unit_name, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
virtual recall_result_ptr check_recall_action(const std::string &id, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
Game information for the AI.
virtual const std::vector< goal_ptr > & get_goals() const =0
virtual const team & current_team() const =0
ai_context * ai_context_ptr
virtual bool get_passive_leader() const
virtual void set_dst_src_enemy_valid_lua()=0
virtual std::map< map_location, defensive_position > & defensive_position_cache() const =0
virtual const std::vector< std::string > get_recruitment_pattern() const
virtual const move_map & get_srcdst() const
virtual double get_caution() const
virtual bool is_src_dst_enemy_valid_lua() const =0
std::map< std::string, aspect_ptr > aspect_map
recursion_counter recursion_counter_
virtual void add_facet(const std::string &id, const config &cfg) const =0
virtual const config get_recruitment_save_gold() const
virtual aspect_map & get_aspects()
virtual const std::vector< goal_ptr > & get_goals() const
virtual const std::vector< std::string > get_recruitment_more() const
virtual const std::vector< engine_ptr > & get_engines() const =0
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
virtual int get_attack_depth() const =0
defensive_position const & best_defensive_position(const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const
virtual bool is_src_dst_enemy_valid_lua() const
virtual stopunit_result_ptr execute_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)
virtual const std::vector< std::string > get_recruitment_pattern() const =0
virtual void add_facet(const std::string &id, const config &cfg) const
virtual bool get_passive_leader_shares_keep() const =0
virtual recruit_result_ptr check_recruit_action(const std::string &unit_name, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())=0
const team & current_team() const
Return a reference to the 'team' object for the AI.
aspect_type< bool >::typesafe_ptr leader_ignores_keep_
virtual move_result_ptr execute_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false)
virtual int get_recursion_count() const
Get the value of the recursion counter.
aspect_type< int >::typesafe_ptr villages_per_scout_
virtual game_info & get_info_w()
virtual const std::vector< std::string > get_recruitment_more() const =0
virtual recall_result_ptr execute_recall_action(const std::string &id, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
Ask the game to recall a unit for us on specified location.
virtual const unit_advancements_aspect & get_advancements() const
aspect_type< config >::typesafe_ptr recruitment_instructions_
std::map< std::pair< map_location, const unit_type * >, std::pair< battle_context_unit_stats, battle_context_unit_stats > > unit_stats_cache_t
virtual const moves_map & get_enemy_possible_moves() const =0
virtual double get_leader_value() const =0
virtual double power_projection(const map_location &loc, const move_map &dstsrc) const
Function which finds how much 'power' a side can attack a certain location with.
aspect_type< double >::typesafe_ptr leader_aggression_
virtual const game_info & get_info() const
virtual void invalidate_move_maps() const =0
aspect_type< double >::typesafe_ptr leader_value_
virtual void on_readonly_context_create()
virtual void diagnostic(const std::string &msg)
virtual const moves_map & get_enemy_possible_moves() const
GLuint const GLchar * name
virtual const team & current_team() const
virtual config to_readonly_context_config() const
serialize to config
virtual config to_readonly_context_config() const
serialize to config
virtual readwrite_context & get_readwrite_context()
Unwrap - this class is not a proxy, so return *this.
virtual bool is_dst_src_valid_lua() const
virtual ~side_context_impl()
virtual config to_side_context_config() const
serialize this context to config
virtual const aspect_map & get_aspects() const
virtual const attacks_vector & get_attacks() const
virtual double get_village_value() const
virtual void set_dst_src_enemy_valid_lua()
aspect_type< double >::typesafe_ptr caution_
aspect_type< std::vector< std::string > >::typesafe_ptr recruitment_pattern_
recursion_counter recursion_counter_
virtual const config get_recruitment_save_gold() const =0
virtual const move_map & get_dstsrc() const =0
virtual void recalculate_move_maps_enemy() const
virtual const aspect_map & get_aspects() const
virtual defensive_position const & best_defensive_position(const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const =0
virtual double get_aggression() const =0
virtual double get_village_value() const
virtual readonly_context & get_readonly_context()=0
virtual std::string get_grouping() const
virtual int get_recruitment_randomness() const
virtual team & current_team_w()
Return a reference to the 'team' object for the AI.
known_aspect_map known_aspects_
virtual side_number get_side() const =0
Get the side number.
virtual double get_leader_value() const
Object which contains all the possible locations a unit can move to, with associated best routes to t...
virtual void recalculate_move_maps() const =0
virtual double get_leader_aggression() const =0
Container associating units to locations.
move_result_ptr check_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false)
Check if it is possible to move our unit from location 'from' to location 'to'.
aspect_type< std::vector< std::string > >::typesafe_ptr recruitment_more_
virtual int get_recursion_count() const
Get the value of the recursion counter.
virtual void recalculate_move_maps() const
void handle_generic_event(const std::string &event_name)
void raise_gamestate_changed() const
Notifies all interested observers of the event respectively.
void init_readwrite_context_proxy(readwrite_context &target)
virtual bool is_src_dst_valid_lua() const
virtual void raise_user_interact() const =0
virtual void raise_gamestate_changed() const
virtual void invalidate_keeps_cache() const
virtual const std::set< map_location > & keeps() const =0
virtual const std::vector< engine_ptr > & get_engines() const
virtual void handle_generic_event(const std::string &event_name)
Handle generic event.
readwrite_context_proxy()
virtual void calculate_moves(const unit_map &units, std::map< map_location, pathfind::paths > &possible_moves, move_map &srcdst, move_map &dstsrc, bool enemy, bool assume_full_movement=false, const terrain_filter *remove_destinations=nullptr, bool see_all=false) const =0
aspect_type< unit_advancements_aspect >::typesafe_ptr advancements_
virtual void set_src_dst_valid_lua()
virtual double get_scout_village_targeting() const =0
A config object defines a single node in a WML file, with access to child nodes.
virtual const std::vector< std::string > get_recruitment_pattern() const
virtual void recalculate_move_maps_enemy() const =0
virtual bool is_dst_src_valid_lua() const =0
virtual attack_result_ptr check_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)
virtual const terrain_filter & get_avoid() const
recruit_result_ptr check_recruit_action(const std::string &unit_name, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
Check if it is possible to recruit a unit for us on specified location.
virtual int get_villages_per_scout() const
virtual bool get_simple_targeting() const
GLsizei const GLcharARB ** string
virtual engine_ptr get_engine_by_cfg(const config &cfg)
get engine by cfg, creating it if it is not created yet but known
virtual void set_src_dst_enemy_valid_lua()
virtual recruit_result_ptr execute_recruit_action(const std::string &unit_name, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
Ask the game to recruit a unit for us on specified location.
void calculate_moves(const unit_map &units, std::map< map_location, pathfind::paths > &possible_moves, move_map &srcdst, move_map &dstsrc, bool enemy, bool assume_full_movement=false, const terrain_filter *remove_destinations=nullptr, bool see_all=false) const
A more fundamental version of calculate_possible_moves which allows the use of a speculative unit map...
virtual int get_recruitment_randomness() const =0
virtual stopunit_result_ptr execute_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)
Ask the game to remove unit movements and/or attack.
virtual const move_map & get_dstsrc() const
virtual const variant & get_attacks_as_variant() const
virtual double get_caution() const =0
virtual team & current_team_w()=0
virtual bool is_src_dst_valid_lua() const
recall_result_ptr check_recall_action(const std::string &id, const map_location &where=map_location::null_location(), const map_location &from=map_location::null_location())
Check if it is possible to recall a unit for us on specified location.
aspect_type< attacks_vector >::typesafe_ptr attacks_
virtual stopunit_result_ptr check_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)
void init_readonly_context_proxy(readonly_context &target)
virtual void set_src_dst_valid_lua()
virtual side_number get_side() const
Get the side number.
virtual readonly_context & get_readonly_context()
Unwrap - this class is not a proxy, so return *this :w
virtual synced_command_result_ptr execute_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())
Ask the game to run Lua code.
bool src_dst_enemy_valid_lua_
virtual int get_recursion_count() const
Get the value of the recursion counter.
virtual move_result_ptr execute_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false)=0
virtual bool get_leader_ignores_keep() const =0
virtual double get_scout_village_targeting() const