44 namespace ai {
class ai_context; }
45 namespace ai {
class unit_advancements_aspect; }
110 const std::set<map_location>&
get();
177 bool assume_full_movement=
false,
178 const terrain_filter* remove_destinations=
nullptr)
const = 0;
180 std::map<map_location,pathfind::paths>& possible_moves,
move_map& srcdst,
181 move_map& dstsrc,
bool enemy,
bool assume_full_movement=
false,
182 const terrain_filter* remove_destinations=
nullptr,
183 bool see_all=
false)
const = 0;
205 virtual void add_aspects(std::vector< aspect_ptr > &aspects ) = 0;
234 virtual const std::vector<goal_ptr>&
get_goals()
const = 0;
302 virtual const std::set<map_location>&
keeps()
const= 0;
340 typedef std::map<std::pair<map_location,const unit_type *>,
341 std::pair<battle_context_unit_stats,battle_context_unit_stats>>
499 bool assume_full_movement=
false,
500 const terrain_filter* remove_destinations=
nullptr)
const override
506 std::map<map_location,pathfind::paths>& possible_moves,
move_map& srcdst,
507 move_map& dstsrc,
bool enemy,
bool assume_full_movement=
false,
508 const terrain_filter* remove_destinations=
nullptr,
509 bool see_all=
false)
const override
566 virtual void add_aspects(std::vector< aspect_ptr > &aspects )
override
586 virtual const terrain_filter&
get_avoid()
const override
621 virtual const std::vector<engine_ptr>&
get_engines()
const override
636 virtual const std::vector<goal_ptr>&
get_goals()
const override
811 virtual const std::set<map_location>&
keeps()
const override
1102 bool assume_full_movement=
false,
1103 const terrain_filter* remove_destinations=
nullptr)
const override;
1113 std::map<map_location,pathfind::paths>& possible_moves,
move_map& srcdst,
1114 move_map& dstsrc,
bool enemy,
bool assume_full_movement=
false,
1115 const terrain_filter* remove_destinations=
nullptr,
1116 bool see_all=
false)
const override;
1150 virtual const terrain_filter&
get_avoid()
const override;
1164 virtual const std::vector<engine_ptr>&
get_engines()
const override;
1166 virtual std::vector<engine_ptr>&
get_engines()
override;
1170 virtual const std::vector<goal_ptr>&
get_goals()
const override;
1172 virtual std::vector<goal_ptr>&
get_goals()
override;
1182 virtual utils::variant<bool, std::vector<std::string>>
get_passive_leader()
const override;
1216 virtual bool is_active(
const std::string &
time_of_day,
const std::string &turns)
const override;
1238 virtual const std::set<map_location>&
keeps()
const override;
1250 virtual void add_aspects(std::vector< aspect_ptr > &aspects)
override;
1252 virtual void add_facet(
const std::string &
id,
const config &cfg)
const override;
1271 template<
typename T>
1274 bool applies_to_leader(
const utils::variant<
bool, std::vector<std::string>> &aspect_value,
const std::string &
id)
const;
void handle_generic_event(const std::string &event_name)
const std::set< map_location > & get()
void init(const gamemap &map)
std::set< map_location > keeps_
virtual double get_caution() const override
virtual ~readonly_context_impl()
Destructor.
virtual void recalculate_move_maps_enemy() const override
std::map< map_location, defensive_position > defensive_position_cache_
stopunit_result_ptr check_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false) override
Check if it is possible to remove unit movements and/or attack.
typesafe_aspect_ptr< utils::variant< bool, std::vector< std::string > > > passive_leader_
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()) override
Check if it is possible to recruit a unit for us on specified location.
virtual bool is_keep_ignoring_leader(const std::string &id) const override
virtual const move_map & get_srcdst() const override
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 override
Calculate the moves units may possibly make.
typesafe_aspect_ptr< std::vector< std::string > > recruitment_more_
virtual bool is_active(const std::string &time_of_day, const std::string &turns) const override
virtual const move_map & get_dstsrc() const override
virtual const std::vector< std::string > get_recruitment_pattern() const override
const defensive_position & best_defensive_position(const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const override
virtual bool get_simple_targeting() const override
typesafe_aspect_ptr< bool > support_villages_
virtual bool is_passive_keep_sharing_leader(const std::string &id) const override
unit_stats_cache_t unit_stats_cache_
void add_known_aspect(const std::string &name, typesafe_aspect_ptr< T > &where)
virtual void add_facet(const std::string &id, const config &cfg) const override
bool move_maps_enemy_valid_
virtual bool get_allow_ally_villages() const override
virtual readonly_context & get_readonly_context() override
virtual std::map< map_location, defensive_position > & defensive_position_cache() const override
attack_result_ptr check_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon) override
Check if it is possible to attack enemy defender using our unit attacker from attackers current locat...
virtual const std::vector< goal_ptr > & get_goals() const override
virtual const game_info & get_info() const override
virtual void recalculate_move_maps() const override
typesafe_aspect_ptr< terrain_filter > avoid_
virtual bool is_dst_src_valid_lua() const override
typesafe_aspect_ptr< bool > simple_targeting_
virtual const move_map & get_enemy_srcdst() const override
virtual double get_recruitment_diversity() const override
virtual bool is_src_dst_enemy_valid_lua() const override
void raise_user_interact() const override
Function which should be called frequently to allow the user to interact with the interface.
virtual double get_retreat_enemy_weight() const override
virtual const std::vector< engine_ptr > & get_engines() const override
virtual const attacks_vector & get_attacks() const override
typesafe_aspect_ptr< attacks_vector > attacks_
virtual const map_location & suitable_keep(const map_location &leader_location, const pathfind::paths &leader_paths) const override
get most suitable keep for leader - nearest free that can be reached in 1 turn, if none - return near...
virtual void invalidate_move_maps() const override
virtual const terrain_filter & get_avoid() const override
virtual int get_recursion_count() const override
Get the value of the recursion counter.
bool applies_to_leader(const utils::variant< bool, std::vector< std::string >> &aspect_value, const std::string &id) const
virtual int get_villages_per_scout() const override
virtual config get_leader_goal() const override
virtual void invalidate_keeps_cache() const override
virtual double get_leader_aggression() const override
readonly_context_impl(side_context &context, const config &cfg)
Constructor.
virtual const aspect_map & get_aspects() const override
virtual const move_map & get_enemy_dstsrc() const override
virtual double get_village_value() const override
typesafe_aspect_ptr< int > recruitment_randomness_
virtual bool is_passive_leader(const std::string &id) const override
const team & current_team() const override
Return a reference to the 'team' object for the AI.
typesafe_aspect_ptr< int > villages_per_scout_
virtual unit_stats_cache_t & unit_stats_cache() const override
Weapon choice cache, to speed simulations.
virtual void set_dst_src_valid_lua() override
typesafe_aspect_ptr< double > recruitment_diversity_
typesafe_aspect_ptr< double > village_value_
virtual void set_src_dst_enemy_valid_lua() override
recursion_counter recursion_counter_
virtual const moves_map & get_enemy_possible_moves() const override
void log_message(const std::string &msg) override
Display a debug message as a chat message.
virtual const map_location & nearest_keep(const map_location &loc) const override
typesafe_aspect_ptr< unit_advancements_aspect > advancements_
typesafe_aspect_ptr< double > retreat_factor_
bool dst_src_enemy_valid_lua_
virtual const config get_recruitment_instructions() const override
virtual double get_aggression() const override
known_aspect_map known_aspects_
typesafe_aspect_ptr< double > retreat_enemy_weight_
synced_command_result_ptr check_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location()) override
Check if it is possible to run Lua code.
virtual double power_projection(const map_location &loc, const move_map &dstsrc) const override
Function which finds how much 'power' a side can attack a certain location with.
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 override
A more fundamental version of calculate_possible_moves which allows the use of a speculative unit map...
virtual void invalidate_defensive_position_cache() const override
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader() const override
typesafe_aspect_ptr< double > leader_value_
typesafe_aspect_ptr< config > recruitment_instructions_
std::vector< engine_ptr > engines_
AI Support Engines.
typesafe_aspect_ptr< utils::variant< bool, std::vector< std::string > > > passive_leader_shares_keep_
virtual bool is_src_dst_valid_lua() const override
virtual void add_aspects(std::vector< aspect_ptr > &aspects) override
virtual bool is_dst_src_enemy_valid_lua() const override
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader_shares_keep() const override
virtual double get_leader_value() const override
typesafe_aspect_ptr< double > scout_village_targeting_
virtual utils::variant< bool, std::vector< std::string > > get_leader_ignores_keep() const override
virtual const std::vector< std::string > get_recruitment_more() const override
virtual const wfl::variant & get_attacks_as_variant() const override
std::vector< goal_ptr > goals_
virtual void set_dst_src_enemy_valid_lua() override
typesafe_aspect_ptr< utils::variant< bool, std::vector< std::string > > > leader_ignores_keep_
typesafe_aspect_ptr< std::vector< std::string > > recruitment_pattern_
virtual const unit_advancements_aspect & get_advancements() const override
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()) override
Check if it is possible to recall a unit for us on specified location.
virtual const std::set< map_location > & keeps() const override
typesafe_aspect_ptr< config > leader_goal_
virtual void handle_generic_event(const std::string &event_name) override
Handle generic event.
virtual bool leader_can_reach_keep() const override
virtual bool get_support_villages() const override
bool src_dst_enemy_valid_lua_
virtual std::string get_grouping() const override
virtual double get_retreat_factor() const override
moves_map possible_moves_
typesafe_aspect_ptr< bool > allow_ally_villages_
moves_map enemy_possible_moves_
virtual const config get_recruitment_save_gold() const override
void diagnostic(const std::string &msg) override
Show a diagnostic message on the screen.
virtual void on_readonly_context_create() override
virtual double get_scout_village_targeting() const override
typesafe_aspect_ptr< double > caution_
virtual const moves_map & get_possible_moves() const override
virtual int get_recruitment_randomness() const override
move_result_ptr check_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false) override
Check if it is possible to move our unit from location 'from' to location 'to'.
typesafe_aspect_ptr< std::string > grouping_
virtual config to_readonly_context_config() const override
serialize to config
typesafe_aspect_ptr< double > aggression_
typesafe_aspect_ptr< config > recruitment_save_gold_
typesafe_aspect_ptr< double > leader_aggression_
virtual engine_ptr get_engine_by_cfg(const config &cfg) override
get engine by cfg, creating it if it is not created yet but known
virtual void set_src_dst_valid_lua() override
virtual double get_caution() const override
virtual std::map< map_location, defensive_position > & defensive_position_cache() const override
virtual const map_location & suitable_keep(const map_location &leader_location, const pathfind::paths &leader_paths) const override
get most suitable keep for leader - nearest free that can be reached in 1 turn, if none - return near...
virtual void invalidate_keeps_cache() const override
virtual config get_leader_goal() const override
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader() const override
virtual const team & current_team() const override
virtual bool is_keep_ignoring_leader(const std::string &id) const override
virtual bool is_passive_keep_sharing_leader(const std::string &id) const override
virtual const move_map & get_enemy_srcdst() const override
virtual synced_command_result_ptr check_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location()) override
virtual std::vector< goal_ptr > & get_goals() override
virtual const wfl::variant & get_attacks_as_variant() const override
virtual void on_readonly_context_create() override
virtual const map_location & nearest_keep(const map_location &loc) const override
virtual const move_map & get_dstsrc() const override
virtual const config get_recruitment_save_gold() const override
virtual const terrain_filter & get_avoid() const override
virtual const aspect_map & get_aspects() const override
virtual void add_aspects(std::vector< aspect_ptr > &aspects) override
virtual const attacks_vector & get_attacks() const override
virtual void log_message(const std::string &msg) override
virtual double get_recruitment_diversity() const override
virtual double get_retreat_enemy_weight() const override
virtual bool leader_can_reach_keep() const override
virtual std::string get_grouping() const override
virtual void recalculate_move_maps() const override
readonly_context * target_
virtual int get_recursion_count() const override
Get the value of the recursion counter.
virtual void set_src_dst_enemy_valid_lua() override
virtual void raise_user_interact() const override
virtual void set_dst_src_enemy_valid_lua() override
virtual const game_info & get_info() const override
virtual void add_facet(const std::string &id, const config &cfg) const override
virtual void invalidate_move_maps() const override
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()) override
virtual const std::set< map_location > & keeps() const override
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 override
virtual double get_retreat_factor() const override
virtual void recalculate_move_maps_enemy() const override
virtual bool get_simple_targeting() const override
virtual bool is_dst_src_valid_lua() const override
virtual void diagnostic(const std::string &msg) override
virtual const move_map & get_srcdst() const override
virtual engine_ptr get_engine_by_cfg(const config &cfg) override
get engine by cfg, creating it if it is not created yet but known
virtual utils::variant< bool, std::vector< std::string > > get_leader_ignores_keep() const override
virtual const unit_advancements_aspect & get_advancements() const override
virtual bool is_src_dst_valid_lua() const override
const defensive_position & best_defensive_position(const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const override
virtual int get_recruitment_randomness() const override
virtual void set_src_dst_valid_lua() override
virtual const config get_recruitment_instructions() const override
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()) override
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 override
virtual const std::vector< goal_ptr > & get_goals() const override
virtual bool is_passive_leader(const std::string &id) const override
virtual void invalidate_defensive_position_cache() const override
virtual const std::vector< engine_ptr > & get_engines() const override
virtual double power_projection(const map_location &loc, const move_map &dstsrc) const override
Function which finds how much 'power' a side can attack a certain location with.
virtual double get_scout_village_targeting() const override
virtual const std::vector< std::string > get_recruitment_pattern() const override
virtual unit_stats_cache_t & unit_stats_cache() const override
virtual double get_village_value() const override
virtual move_result_ptr check_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false) override
virtual double get_leader_value() const override
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader_shares_keep() const override
virtual double get_aggression() const override
virtual ~readonly_context_proxy()
virtual stopunit_result_ptr check_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false) override
virtual const moves_map & get_enemy_possible_moves() const override
virtual const std::vector< std::string > get_recruitment_more() const override
virtual bool is_src_dst_enemy_valid_lua() const override
virtual aspect_map & get_aspects() override
virtual bool is_dst_src_enemy_valid_lua() const override
virtual int get_villages_per_scout() const override
virtual std::vector< engine_ptr > & get_engines() override
virtual readonly_context & get_readonly_context() override
virtual config to_readonly_context_config() const override
serialize to config
virtual bool is_active(const std::string &time_of_day, const std::string &turns) const override
virtual double get_leader_aggression() const override
virtual void set_dst_src_valid_lua() override
void init_readonly_context_proxy(readonly_context &target)
virtual bool get_support_villages() const override
virtual bool get_allow_ally_villages() const override
virtual const move_map & get_enemy_dstsrc() const override
virtual attack_result_ptr check_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon) override
virtual const moves_map & get_possible_moves() const override
virtual void add_facet(const std::string &id, const config &cfg) const =0
virtual int get_villages_per_scout() const =0
virtual std::string get_grouping() const =0
virtual const std::vector< engine_ptr > & get_engines() const =0
virtual const terrain_filter & get_avoid() const =0
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 bool get_simple_targeting() const =0
virtual void recalculate_move_maps() const =0
virtual const aspect_map & get_aspects() 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 =0
virtual const std::vector< goal_ptr > & get_goals() const =0
virtual const attacks_vector & get_attacks() const =0
virtual std::vector< goal_ptr > & get_goals()=0
virtual config to_readonly_context_config() const =0
serialize to config
virtual void set_dst_src_valid_lua()=0
virtual const move_map & get_enemy_srcdst() const =0
virtual const defensive_position & best_defensive_position(const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const =0
virtual bool is_passive_leader(const std::string &id) const =0
virtual utils::variant< bool, std::vector< std::string > > get_leader_ignores_keep() const =0
virtual const move_map & get_enemy_dstsrc() const =0
virtual bool is_src_dst_enemy_valid_lua() const =0
virtual config get_leader_goal() 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
virtual void invalidate_move_maps() const =0
virtual synced_command_result_ptr check_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())=0
virtual const map_location & nearest_keep(const map_location &loc) const =0
virtual double get_aggression() const =0
virtual int get_recruitment_randomness() const =0
virtual unit_stats_cache_t & unit_stats_cache() const =0
virtual double get_retreat_factor() const =0
virtual std::vector< engine_ptr > & get_engines()=0
virtual bool is_src_dst_valid_lua() const =0
virtual bool is_dst_src_enemy_valid_lua() const =0
virtual const team & current_team() const =0
virtual const map_location & suitable_keep(const map_location &leader_location, const pathfind::paths &leader_paths) const =0
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 =0
virtual stopunit_result_ptr check_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)=0
virtual void set_src_dst_enemy_valid_lua()=0
virtual bool is_keep_ignoring_leader(const std::string &id) const =0
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 const move_map & get_srcdst() const =0
virtual void set_dst_src_enemy_valid_lua()=0
virtual void on_readonly_context_create()=0
virtual bool is_active(const std::string &time_of_day, const std::string &turns) const =0
virtual bool leader_can_reach_keep() const =0
virtual double get_caution() const =0
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader() const =0
virtual void recalculate_move_maps_enemy() const =0
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 wfl::variant & get_attacks_as_variant() const =0
virtual bool get_allow_ally_villages() const =0
virtual void diagnostic(const std::string &msg)=0
virtual readonly_context & get_readonly_context()=0
virtual bool is_dst_src_valid_lua() const =0
virtual std::map< map_location, defensive_position > & defensive_position_cache() const =0
virtual const std::vector< std::string > get_recruitment_pattern() const =0
virtual const config get_recruitment_instructions() const =0
virtual double get_retreat_enemy_weight() const =0
virtual double get_scout_village_targeting() const =0
virtual void raise_user_interact() const =0
virtual double get_recruitment_diversity() const =0
virtual double get_leader_aggression() const =0
virtual bool get_support_villages() const =0
virtual const move_map & get_dstsrc() const =0
virtual aspect_map & get_aspects()=0
virtual bool is_passive_keep_sharing_leader(const std::string &id) const =0
virtual const std::vector< std::string > get_recruitment_more() const =0
virtual void set_src_dst_valid_lua()=0
virtual const std::set< map_location > & keeps() const =0
virtual const moves_map & get_possible_moves() const =0
virtual const config get_recruitment_save_gold() const =0
virtual void log_message(const std::string &msg)=0
virtual attack_result_ptr check_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)=0
virtual void add_aspects(std::vector< aspect_ptr > &aspects)=0
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 const game_info & get_info() 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 double get_village_value() const =0
virtual ~readonly_context()
virtual const unit_advancements_aspect & get_advancements() const =0
virtual void invalidate_defensive_position_cache() const =0
virtual void invalidate_keeps_cache() const =0
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader_shares_keep() const =0
virtual const moves_map & get_enemy_possible_moves() const =0
virtual double get_leader_value() const =0
virtual game_info & get_info_w() override
Functions to retrieve the 'info' object.
virtual synced_command_result_ptr execute_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location()) override
Ask the game to run Lua code.
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()) override
Ask the game to recruit a unit for us on specified location.
virtual config to_readwrite_context_config() const override
serialize this context to config
void raise_gamestate_changed() const override
Notifies all interested observers of the event respectively.
virtual move_result_ptr execute_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false) override
Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial mov...
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()) override
Ask the game to recall a unit for us on specified location.
virtual stopunit_result_ptr execute_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false) override
Ask the game to remove unit movements and/or attack.
recursion_counter recursion_counter_
virtual ~readwrite_context_impl()
virtual readwrite_context & get_readwrite_context() override
Unwrap - this class is not a proxy, so return *this.
virtual team & current_team_w() override
Return a reference to the 'team' object for the AI.
virtual attack_result_ptr execute_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon) override
Ask the game to attack an enemy defender using our unit attacker from attackers current location,...
readwrite_context_impl(readonly_context &context, const config &)
Constructor.
virtual int get_recursion_count() const override
Get the value of the recursion counter.
virtual attack_result_ptr execute_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon) override
virtual game_info & get_info_w() override
virtual readwrite_context & get_readwrite_context() override
virtual config to_readwrite_context_config() const override
serialize this context to config
readwrite_context_proxy()
readwrite_context * target_
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()) override
virtual stopunit_result_ptr execute_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false) override
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()) override
virtual int get_recursion_count() const override
Get the value of the recursion counter.
virtual synced_command_result_ptr execute_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location()) override
virtual move_result_ptr execute_move_action(const map_location &from, const map_location &to, bool remove_movement=true, bool unreach_is_ok=false) override
void init_readwrite_context_proxy(readwrite_context &target)
virtual team & current_team_w() override
virtual void raise_gamestate_changed() const override
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 attack_result_ptr execute_attack_action(const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon)=0
virtual ~readwrite_context()
virtual readwrite_context & get_readwrite_context()=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)=0
virtual void raise_gamestate_changed() const =0
virtual synced_command_result_ptr execute_synced_command_action(const std::string &lua_code, const map_location &location=map_location::null_location())=0
virtual game_info & get_info_w()=0
virtual config to_readwrite_context_config() const =0
serialize this context to config
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 team & current_team_w()=0
virtual stopunit_result_ptr execute_stopunit_action(const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false)=0
recursion_counter(int counter)
static const int MAX_COUNTER_VALUE
bool is_ok() const
Check if more recursion is allowed.
int get_count() const
Get the current value of the recursion counter.
virtual ~side_context_impl()
virtual side_number get_side() const override
Get the side number.
virtual config to_side_context_config() const override
serialize this context to config
virtual void set_side(side_number side) override
Set the side number.
side_context_impl(side_number side, const config &)
virtual int get_recursion_count() const override
Get the value of the recursion counter.
virtual side_context & get_side_context() override
unwrap
recursion_counter recursion_counter_
virtual int get_recursion_count() const override
Get the value of the recursion counter.
virtual void set_side(side_number side) override
Set the side number.
virtual side_context & get_side_context() override
unwrap
virtual config to_side_context_config() const override
serialize this context to config
void init_side_context_proxy(side_context &target)
virtual ~side_context_proxy()
virtual side_number get_side() const override
Get the side number.
virtual ~side_context()
empty destructor
virtual void set_side(side_number side)=0
Set the side number.
virtual config to_side_context_config() const =0
serialize this context to config
virtual int get_recursion_count() const =0
Get the value of the recursion counter.
virtual side_context & get_side_context()=0
unwrap
virtual side_number get_side() const =0
Get the side number.
side_context()
empty constructor
A config object defines a single node in a WML file, with access to child nodes.
Encapsulates the map of the game.
This class stores all the data for a single 'side' (in game nomenclature).
Container associating units to locations.
A single unit type that the player may recruit.
This class represents a single unit of a specific type.
Definitions for the interface to Wesnoth Markup Language (WML).
Game information for the AI.
A small explanation about what's going on here: Each action has access to two game_info objects First...
std::shared_ptr< engine > engine_ptr
std::vector< attack_analysis > attacks_vector
std::shared_ptr< recruit_result > recruit_result_ptr
std::shared_ptr< typesafe_aspect< T > > typesafe_aspect_ptr
std::map< std::string, known_aspect_ptr > known_aspect_map
std::shared_ptr< attack_result > attack_result_ptr
std::shared_ptr< stopunit_result > stopunit_result_ptr
std::multimap< map_location, map_location > move_map
The standard way in which a map of possible moves is recorded.
std::shared_ptr< synced_command_result > synced_command_result_ptr
std::map< map_location, pathfind::paths > moves_map
The standard way in which a map of possible movement routes to location is recorded.
ai_context * ai_context_ptr
std::shared_ptr< move_result > move_result_ptr
std::shared_ptr< recall_result > recall_result_ptr
std::map< std::string, aspect_ptr > aspect_map
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
@ enemy
Belongs to a non-friendly side; normally visualised by not displaying an orb.
static config unit_name(const unit *u)
Structure describing the statistics of a unit involved in the battle.
Error used for any general game error, e.g.
Encapsulates the map of the game.
static const map_location & null_location()
Object which contains all the possible locations a unit can move to, with associated best routes to t...
Object which defines a time of day with associated bonuses, image, sounds etc.