The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Private Attributes | List of all members
ai::readonly_context_proxy Class Reference

#include <contexts.hpp>

Inheritance diagram for ai::readonly_context_proxy:

Public Member Functions

 readonly_context_proxy ()
 
virtual ~readonly_context_proxy ()
 
void init_readonly_context_proxy (readonly_context &target)
 
virtual readonly_contextget_readonly_context () override
 
virtual void on_readonly_context_create () override
 
virtual const teamcurrent_team () const override
 
virtual void diagnostic (const std::string &msg) override
 
virtual void log_message (const std::string &msg) override
 
virtual attack_result_ptr check_attack_action (const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon) 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 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 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 stopunit_result_ptr check_stopunit_action (const map_location &unit_location, bool remove_movement=true, bool remove_attacks=false) 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 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 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 const game_infoget_info () const override
 
virtual void raise_user_interact () const override
 
virtual int get_recursion_count () const override
 Get the value of the recursion counter. More...
 
const defensive_positionbest_defensive_position (const map_location &unit, const move_map &dstsrc, const move_map &srcdst, const move_map &enemy_dstsrc) const override
 
virtual std::map< map_location, defensive_position > & defensive_position_cache () const override
 
virtual const unit_advancements_aspectget_advancements () const override
 
virtual double get_aggression () const override
 
virtual bool get_allow_ally_villages () const override
 
virtual const aspect_mapget_aspects () const override
 
virtual aspect_mapget_aspects () override
 
virtual void add_aspects (std::vector< aspect_ptr > &aspects) override
 
virtual void add_facet (const std::string &id, const config &cfg) const override
 
virtual const attacks_vectorget_attacks () const override
 
virtual const wfl::variantget_attacks_as_variant () const override
 
virtual const terrain_filterget_avoid () const override
 
virtual double get_caution () const override
 
virtual const move_mapget_dstsrc () const override
 
virtual const move_mapget_enemy_dstsrc () const override
 
virtual const moves_mapget_enemy_possible_moves () const override
 
virtual const move_mapget_enemy_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 More...
 
virtual const std::vector< engine_ptr > & get_engines () const override
 
virtual std::vector< engine_ptr > & get_engines () override
 
virtual std::string get_grouping () const override
 
virtual const std::vector< goal_ptr > & get_goals () const override
 
virtual std::vector< goal_ptr > & get_goals () override
 
virtual double get_leader_aggression () const override
 
virtual config get_leader_goal () const override
 
virtual utils::variant< bool, std::vector< std::string > > get_leader_ignores_keep () const override
 
virtual double get_leader_value () const override
 
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader () const override
 
virtual utils::variant< bool, std::vector< std::string > > get_passive_leader_shares_keep () const override
 
virtual const moves_mapget_possible_moves () 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. More...
 
virtual double get_recruitment_diversity () const override
 
virtual const config get_recruitment_instructions () const override
 
virtual const std::vector< std::string > get_recruitment_more () const override
 
virtual const std::vector< std::string > get_recruitment_pattern () const override
 
virtual int get_recruitment_randomness () const override
 
virtual const config get_recruitment_save_gold () const override
 
virtual const move_mapget_srcdst () const override
 
virtual double get_retreat_enemy_weight () const override
 
virtual double get_retreat_factor () const override
 
virtual double get_scout_village_targeting () const override
 
virtual bool get_simple_targeting () const override
 
virtual bool get_support_villages () const override
 
virtual double get_village_value () const override
 
virtual int get_villages_per_scout () const override
 
virtual bool is_active (const std::string &time_of_day, const std::string &turns) const override
 
virtual bool is_keep_ignoring_leader (const std::string &id) const override
 
virtual bool is_passive_leader (const std::string &id) const override
 
virtual bool is_passive_keep_sharing_leader (const std::string &id) const override
 
virtual bool is_dst_src_valid_lua () const override
 
virtual bool is_dst_src_enemy_valid_lua () const override
 
virtual bool is_src_dst_valid_lua () const override
 
virtual bool is_src_dst_enemy_valid_lua () const override
 
virtual void invalidate_defensive_position_cache () const override
 
virtual void invalidate_move_maps () const override
 
virtual void invalidate_keeps_cache () const override
 
virtual const std::set< map_location > & keeps () const override
 
virtual bool leader_can_reach_keep () const override
 
virtual const map_locationnearest_keep (const map_location &loc) const override
 
virtual void recalculate_move_maps () const override
 
virtual void recalculate_move_maps_enemy () const override
 
virtual void set_dst_src_valid_lua () override
 
virtual void set_dst_src_enemy_valid_lua () override
 
virtual void set_src_dst_valid_lua () override
 
virtual void set_src_dst_enemy_valid_lua () override
 
virtual const map_locationsuitable_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 nearest occupied that can be reached in 1 turn, if none - return nearest keep, if none - return null_location More...
 
virtual config to_readonly_context_config () const override
 serialize to config More...
 
virtual unit_stats_cache_tunit_stats_cache () const override
 
- Public Member Functions inherited from ai::readonly_context
 readonly_context ()
 
virtual ~readonly_context ()
 
- Public Member Functions inherited from ai::side_context
virtual ~side_context ()
 empty destructor More...
 
 side_context ()
 empty constructor More...
 
- Public Member Functions inherited from ai::side_context_proxy
 side_context_proxy ()
 
virtual ~side_context_proxy ()
 
void init_side_context_proxy (side_context &target)
 
virtual side_number get_side () const override
 Get the side number. More...
 
virtual void set_side (side_number side) override
 Set the side number. More...
 
virtual side_contextget_side_context () override
 unwrap More...
 
virtual config to_side_context_config () const override
 serialize this context to config More...
 

Private Attributes

readonly_contexttarget_
 

Additional Inherited Members

- Public Types inherited from ai::readonly_context
typedef std::map< std::pair< map_location, const unit_type * >, std::pair< battle_context_unit_stats, battle_context_unit_stats > > unit_stats_cache_t
 

Detailed Description

Definition at line 425 of file contexts.hpp.

Constructor & Destructor Documentation

◆ readonly_context_proxy()

ai::readonly_context_proxy::readonly_context_proxy ( )
inline

Definition at line 427 of file contexts.hpp.

◆ ~readonly_context_proxy()

virtual ai::readonly_context_proxy::~readonly_context_proxy ( )
inlinevirtual

Definition at line 432 of file contexts.hpp.

Member Function Documentation

◆ add_aspects()

virtual void ai::readonly_context_proxy::add_aspects ( std::vector< aspect_ptr > &  aspects)
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 566 of file contexts.hpp.

References ai::readonly_context::add_aspects(), and target_.

◆ add_facet()

virtual void ai::readonly_context_proxy::add_facet ( const std::string &  id,
const config cfg 
) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 571 of file contexts.hpp.

References ai::readonly_context::add_facet(), and target_.

◆ best_defensive_position()

const defensive_position& ai::readonly_context_proxy::best_defensive_position ( const map_location unit,
const move_map dstsrc,
const move_map srcdst,
const move_map enemy_dstsrc 
) const
inlineoverridevirtual

◆ calculate_moves()

virtual void ai::readonly_context_proxy::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
inlineoverridevirtual

◆ calculate_possible_moves()

virtual void ai::readonly_context_proxy::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
inlineoverridevirtual

◆ check_attack_action()

virtual attack_result_ptr ai::readonly_context_proxy::check_attack_action ( const map_location attacker_loc,
const map_location defender_loc,
int  attacker_weapon 
)
inlineoverridevirtual

◆ check_move_action()

virtual move_result_ptr ai::readonly_context_proxy::check_move_action ( const map_location from,
const map_location to,
bool  remove_movement = true,
bool  unreach_is_ok = false 
)
inlineoverridevirtual

◆ check_recall_action()

virtual recall_result_ptr ai::readonly_context_proxy::check_recall_action ( const std::string &  id,
const map_location where = map_location::null_location(),
const map_location from = map_location::null_location() 
)
inlineoverridevirtual

◆ check_recruit_action()

virtual recruit_result_ptr ai::readonly_context_proxy::check_recruit_action ( const std::string &  unit_name,
const map_location where = map_location::null_location(),
const map_location from = map_location::null_location() 
)
inlineoverridevirtual

◆ check_stopunit_action()

virtual stopunit_result_ptr ai::readonly_context_proxy::check_stopunit_action ( const map_location unit_location,
bool  remove_movement = true,
bool  remove_attacks = false 
)
inlineoverridevirtual

◆ check_synced_command_action()

virtual synced_command_result_ptr ai::readonly_context_proxy::check_synced_command_action ( const std::string &  lua_code,
const map_location location = map_location::null_location() 
)
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 492 of file contexts.hpp.

References ai::readonly_context::check_synced_command_action(), and target_.

◆ current_team()

virtual const team& ai::readonly_context_proxy::current_team ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 450 of file contexts.hpp.

References ai::readonly_context::current_team(), and target_.

Referenced by ai::ai_default_rca::move_to_targets_phase::access_points(), ai::protect_goal::add_targets(), ai::ai_default_rca::aspect_attacks_base::analyze_targets(), ai::ai_default_rca::move_to_targets_phase::choose_move(), wfl::attack_map_callable::collect_possible_attacks(), ai::default_ai_context_impl::count_free_hexes_in_castle(), ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), ai::default_recruitment::recruitment::do_combat_analysis(), ai::ai_default_rca::goto_phase::evaluate(), ai::ai_default_rca::move_leader_to_goals_phase::evaluate(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), ai::ai_default_rca::leader_shares_keep_phase::evaluate(), ai::default_recruitment::recruitment::evaluate(), ai::ai_default_rca::get_villages_phase::execute(), ai::default_recruitment::recruitment::execute(), ai::default_ai_context_impl::find_targets(), ai::ai_default_rca::get_villages_phase::find_villages(), ai::formula_ai::get_allowed_teleports(), ai::default_recruitment::recruitment::get_appropriate_recall(), ai::default_recruitment::recruitment::get_cheapest_unit_cost_for_leader(), ai::default_recruitment::recruitment::get_unit_ratio(), ai::formula_ai::get_value(), ai::default_recruitment::recruitment::is_enemy_in_radius(), ai::default_recruitment::recruitment::recall_unit_value(), ai::formula_ai::shortest_path_calculator(), ai::default_recruitment::recruitment::update_important_hexes(), and ai::default_recruitment::recruitment::update_state().

◆ defensive_position_cache()

virtual std::map<map_location,defensive_position>& ai::readonly_context_proxy::defensive_position_cache ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 536 of file contexts.hpp.

References ai::readonly_context::defensive_position_cache(), and target_.

◆ diagnostic()

virtual void ai::readonly_context_proxy::diagnostic ( const std::string &  msg)
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 455 of file contexts.hpp.

References ai::readonly_context::diagnostic(), wfl::msg(), and target_.

◆ get_advancements()

virtual const unit_advancements_aspect& ai::readonly_context_proxy::get_advancements ( ) const
inlineoverridevirtual

◆ get_aggression()

virtual double ai::readonly_context_proxy::get_aggression ( ) const
inlineoverridevirtual

◆ get_allow_ally_villages()

virtual bool ai::readonly_context_proxy::get_allow_ally_villages ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 551 of file contexts.hpp.

References ai::readonly_context::get_allow_ally_villages(), and target_.

Referenced by ai::formula_ai::get_value().

◆ get_aspects() [1/2]

virtual const aspect_map& ai::readonly_context_proxy::get_aspects ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 556 of file contexts.hpp.

References ai::readonly_context::get_aspects(), and target_.

Referenced by ai::ai_composite::on_create().

◆ get_aspects() [2/2]

virtual aspect_map& ai::readonly_context_proxy::get_aspects ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 561 of file contexts.hpp.

References ai::readonly_context::get_aspects(), and target_.

◆ get_attacks()

virtual const attacks_vector& ai::readonly_context_proxy::get_attacks ( ) const
inlineoverridevirtual

◆ get_attacks_as_variant()

virtual const wfl::variant& ai::readonly_context_proxy::get_attacks_as_variant ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 581 of file contexts.hpp.

References ai::readonly_context::get_attacks_as_variant(), and target_.

Referenced by ai::formula_ai::get_value().

◆ get_avoid()

virtual const terrain_filter& ai::readonly_context_proxy::get_avoid ( ) const
inlineoverridevirtual

◆ get_caution()

virtual double ai::readonly_context_proxy::get_caution ( ) const
inlineoverridevirtual

◆ get_dstsrc()

virtual const move_map& ai::readonly_context_proxy::get_dstsrc ( ) const
inlineoverridevirtual

◆ get_enemy_dstsrc()

virtual const move_map& ai::readonly_context_proxy::get_enemy_dstsrc ( ) const
inlineoverridevirtual

◆ get_enemy_possible_moves()

virtual const moves_map& ai::readonly_context_proxy::get_enemy_possible_moves ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 606 of file contexts.hpp.

References ai::readonly_context::get_enemy_possible_moves(), and target_.

◆ get_enemy_srcdst()

virtual const move_map& ai::readonly_context_proxy::get_enemy_srcdst ( ) const
inlineoverridevirtual

◆ get_engine_by_cfg()

virtual engine_ptr ai::readonly_context_proxy::get_engine_by_cfg ( const config cfg)
inlineoverridevirtual

get engine by cfg, creating it if it is not created yet but known

Implements ai::readonly_context.

Definition at line 616 of file contexts.hpp.

References ai::readonly_context::get_engine_by_cfg(), and target_.

Referenced by ai::ai_composite::evaluate(), and ai::ai_composite::on_create().

◆ get_engines() [1/2]

virtual const std::vector<engine_ptr>& ai::readonly_context_proxy::get_engines ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 621 of file contexts.hpp.

References ai::readonly_context::get_engines(), and target_.

Referenced by ai::ai_composite::on_create().

◆ get_engines() [2/2]

virtual std::vector<engine_ptr>& ai::readonly_context_proxy::get_engines ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 626 of file contexts.hpp.

References ai::readonly_context::get_engines(), and target_.

◆ get_goals() [1/2]

virtual const std::vector<goal_ptr>& ai::readonly_context_proxy::get_goals ( ) const
inlineoverridevirtual

◆ get_goals() [2/2]

virtual std::vector<goal_ptr>& ai::readonly_context_proxy::get_goals ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 641 of file contexts.hpp.

References ai::readonly_context::get_goals(), and target_.

◆ get_grouping()

virtual std::string ai::readonly_context_proxy::get_grouping ( ) const
inlineoverridevirtual

◆ get_info()

virtual const game_info& ai::readonly_context_proxy::get_info ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 514 of file contexts.hpp.

References ai::readonly_context::get_info(), and target_.

◆ get_leader_aggression()

virtual double ai::readonly_context_proxy::get_leader_aggression ( ) const
inlineoverridevirtual

◆ get_leader_goal()

virtual config ai::readonly_context_proxy::get_leader_goal ( ) const
inlineoverridevirtual

◆ get_leader_ignores_keep()

virtual utils::variant<bool, std::vector<std::string> > ai::readonly_context_proxy::get_leader_ignores_keep ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 656 of file contexts.hpp.

References ai::readonly_context::get_leader_ignores_keep(), and target_.

Referenced by ai::formula_ai::get_value().

◆ get_leader_value()

virtual double ai::readonly_context_proxy::get_leader_value ( ) const
inlineoverridevirtual

◆ get_passive_leader()

virtual utils::variant<bool, std::vector<std::string> > ai::readonly_context_proxy::get_passive_leader ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 666 of file contexts.hpp.

References ai::readonly_context::get_passive_leader(), and target_.

Referenced by ai::formula_ai::get_value().

◆ get_passive_leader_shares_keep()

virtual utils::variant<bool, std::vector<std::string> > ai::readonly_context_proxy::get_passive_leader_shares_keep ( ) const
inlineoverridevirtual

◆ get_possible_moves()

virtual const moves_map& ai::readonly_context_proxy::get_possible_moves ( ) const
inlineoverridevirtual

◆ get_readonly_context()

virtual readonly_context& ai::readonly_context_proxy::get_readonly_context ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 440 of file contexts.hpp.

References ai::readonly_context::get_readonly_context(), and target_.

◆ get_recruitment_diversity()

virtual double ai::readonly_context_proxy::get_recruitment_diversity ( ) const
inlineoverridevirtual

◆ get_recruitment_instructions()

virtual const config ai::readonly_context_proxy::get_recruitment_instructions ( ) const
inlineoverridevirtual

◆ get_recruitment_more()

virtual const std::vector<std::string> ai::readonly_context_proxy::get_recruitment_more ( ) const
inlineoverridevirtual

◆ get_recruitment_pattern()

virtual const std::vector<std::string> ai::readonly_context_proxy::get_recruitment_pattern ( ) const
inlineoverridevirtual

◆ get_recruitment_randomness()

virtual int ai::readonly_context_proxy::get_recruitment_randomness ( ) const
inlineoverridevirtual

◆ get_recruitment_save_gold()

virtual const config ai::readonly_context_proxy::get_recruitment_save_gold ( ) const
inlineoverridevirtual

◆ get_recursion_count()

virtual int ai::readonly_context_proxy::get_recursion_count ( ) const
inlineoverridevirtual

◆ get_retreat_enemy_weight()

virtual double ai::readonly_context_proxy::get_retreat_enemy_weight ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 721 of file contexts.hpp.

References ai::readonly_context::get_retreat_enemy_weight(), and target_.

Referenced by ai::formula_ai::get_value().

◆ get_retreat_factor()

virtual double ai::readonly_context_proxy::get_retreat_factor ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 726 of file contexts.hpp.

References ai::readonly_context::get_retreat_factor(), and target_.

Referenced by ai::formula_ai::get_value().

◆ get_scout_village_targeting()

virtual double ai::readonly_context_proxy::get_scout_village_targeting ( ) const
inlineoverridevirtual

◆ get_simple_targeting()

virtual bool ai::readonly_context_proxy::get_simple_targeting ( ) const
inlineoverridevirtual

◆ get_srcdst()

virtual const move_map& ai::readonly_context_proxy::get_srcdst ( ) const
inlineoverridevirtual

◆ get_support_villages()

virtual bool ai::readonly_context_proxy::get_support_villages ( ) const
inlineoverridevirtual

◆ get_village_value()

virtual double ai::readonly_context_proxy::get_village_value ( ) const
inlineoverridevirtual

◆ get_villages_per_scout()

virtual int ai::readonly_context_proxy::get_villages_per_scout ( ) const
inlineoverridevirtual

◆ init_readonly_context_proxy()

void ai::readonly_context_proxy::init_readonly_context_proxy ( readonly_context target)
inline

◆ invalidate_defensive_position_cache()

virtual void ai::readonly_context_proxy::invalidate_defensive_position_cache ( ) const
inlineoverridevirtual

◆ invalidate_keeps_cache()

virtual void ai::readonly_context_proxy::invalidate_keeps_cache ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 806 of file contexts.hpp.

References ai::readonly_context::invalidate_keeps_cache(), and target_.

Referenced by ai::ai_composite::new_turn().

◆ invalidate_move_maps()

virtual void ai::readonly_context_proxy::invalidate_move_maps ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 801 of file contexts.hpp.

References ai::readonly_context::invalidate_move_maps(), and target_.

◆ is_active()

virtual bool ai::readonly_context_proxy::is_active ( const std::string &  time_of_day,
const std::string &  turns 
) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 756 of file contexts.hpp.

References ai::readonly_context::is_active(), and target_.

Referenced by ai::aspect::active(), and ai::goal::active().

◆ is_dst_src_enemy_valid_lua()

virtual bool ai::readonly_context_proxy::is_dst_src_enemy_valid_lua ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 781 of file contexts.hpp.

References ai::readonly_context::is_dst_src_enemy_valid_lua(), and target_.

◆ is_dst_src_valid_lua()

virtual bool ai::readonly_context_proxy::is_dst_src_valid_lua ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 776 of file contexts.hpp.

References ai::readonly_context::is_dst_src_valid_lua(), and target_.

◆ is_keep_ignoring_leader()

virtual bool ai::readonly_context_proxy::is_keep_ignoring_leader ( const std::string &  id) const
inlineoverridevirtual

◆ is_passive_keep_sharing_leader()

virtual bool ai::readonly_context_proxy::is_passive_keep_sharing_leader ( const std::string &  id) const
inlineoverridevirtual

◆ is_passive_leader()

virtual bool ai::readonly_context_proxy::is_passive_leader ( const std::string &  id) const
inlineoverridevirtual

◆ is_src_dst_enemy_valid_lua()

virtual bool ai::readonly_context_proxy::is_src_dst_enemy_valid_lua ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 791 of file contexts.hpp.

References ai::readonly_context::is_src_dst_enemy_valid_lua(), and target_.

◆ is_src_dst_valid_lua()

virtual bool ai::readonly_context_proxy::is_src_dst_valid_lua ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 786 of file contexts.hpp.

References ai::readonly_context::is_src_dst_valid_lua(), and target_.

◆ keeps()

virtual const std::set<map_location>& ai::readonly_context_proxy::keeps ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 811 of file contexts.hpp.

References ai::readonly_context::keeps(), and target_.

◆ leader_can_reach_keep()

virtual bool ai::readonly_context_proxy::leader_can_reach_keep ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 816 of file contexts.hpp.

References ai::readonly_context::leader_can_reach_keep(), and target_.

◆ log_message()

virtual void ai::readonly_context_proxy::log_message ( const std::string &  msg)
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 460 of file contexts.hpp.

References ai::readonly_context::log_message(), wfl::msg(), and target_.

◆ nearest_keep()

virtual const map_location& ai::readonly_context_proxy::nearest_keep ( const map_location loc) const
inlineoverridevirtual

◆ on_readonly_context_create()

virtual void ai::readonly_context_proxy::on_readonly_context_create ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 445 of file contexts.hpp.

References ai::readonly_context::on_readonly_context_create(), and target_.

◆ power_projection()

virtual double ai::readonly_context_proxy::power_projection ( const map_location loc,
const move_map dstsrc 
) const
inlineoverridevirtual

Function which finds how much 'power' a side can attack a certain location with.

This is basically the maximum hp of damage that can be inflicted upon a unit on loc by full-health units, multiplied by the defense these units will have. (if 'use_terrain' is false, then it will be multiplied by 0.5)

Example: 'loc' can be reached by two units, one of whom has a 10-3 attack and has 48/48 hp, and can defend at 40% on the adjacent grassland. The other has a 8-2 attack, and has 30/40 hp, and can defend at 60% on the adjacent mountain. The rating will be 10*3*1.0*0.4 + 8*2*0.75*0.6 = 19.2

Implements ai::readonly_context.

Definition at line 681 of file contexts.hpp.

References loc, ai::readonly_context::power_projection(), and target_.

Referenced by ai::ai_default_rca::move_to_targets_phase::choose_move(), ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), ai::ai_default_rca::move_leader_to_goals_phase::evaluate(), ai::ai_default_rca::get_healing_phase::evaluate(), ai::ai_default_rca::retreat_phase::evaluate(), ai::ai_default_rca::get_villages_phase::execute(), ai::default_recruitment::recruitment::execute(), ai::default_ai_context_impl::find_targets(), ai::ai_default_rca::get_villages_phase::find_villages(), ai::ai_default_rca::move_to_targets_phase::should_retreat(), and ai::ai_default_rca::retreat_phase::should_retreat().

◆ raise_user_interact()

virtual void ai::readonly_context_proxy::raise_user_interact ( ) const
inlineoverridevirtual

◆ recalculate_move_maps()

virtual void ai::readonly_context_proxy::recalculate_move_maps ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 826 of file contexts.hpp.

References ai::readonly_context::recalculate_move_maps(), and target_.

Referenced by ai::ai_composite::new_turn().

◆ recalculate_move_maps_enemy()

virtual void ai::readonly_context_proxy::recalculate_move_maps_enemy ( ) const
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 831 of file contexts.hpp.

References ai::readonly_context::recalculate_move_maps_enemy(), and target_.

◆ set_dst_src_enemy_valid_lua()

virtual void ai::readonly_context_proxy::set_dst_src_enemy_valid_lua ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 841 of file contexts.hpp.

References ai::readonly_context::set_dst_src_enemy_valid_lua(), and target_.

◆ set_dst_src_valid_lua()

virtual void ai::readonly_context_proxy::set_dst_src_valid_lua ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 836 of file contexts.hpp.

References ai::readonly_context::set_dst_src_valid_lua(), and target_.

◆ set_src_dst_enemy_valid_lua()

virtual void ai::readonly_context_proxy::set_src_dst_enemy_valid_lua ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 851 of file contexts.hpp.

References ai::readonly_context::set_src_dst_enemy_valid_lua(), and target_.

◆ set_src_dst_valid_lua()

virtual void ai::readonly_context_proxy::set_src_dst_valid_lua ( )
inlineoverridevirtual

Implements ai::readonly_context.

Definition at line 846 of file contexts.hpp.

References ai::readonly_context::set_src_dst_valid_lua(), and target_.

◆ suitable_keep()

virtual const map_location& ai::readonly_context_proxy::suitable_keep ( const map_location leader_location,
const pathfind::paths leader_paths 
) const
inlineoverridevirtual

get most suitable keep for leader - nearest free that can be reached in 1 turn, if none - return nearest occupied that can be reached in 1 turn, if none - return nearest keep, if none - return null_location

Implements ai::readonly_context.

Definition at line 856 of file contexts.hpp.

References ai::readonly_context::suitable_keep(), and target_.

Referenced by ai::ai_default_rca::move_leader_to_keep_phase::evaluate().

◆ to_readonly_context_config()

virtual config ai::readonly_context_proxy::to_readonly_context_config ( ) const
inlineoverridevirtual

serialize to config

Implements ai::readonly_context.

Definition at line 861 of file contexts.hpp.

References target_, and ai::readonly_context::to_readonly_context_config().

◆ unit_stats_cache()

virtual unit_stats_cache_t& ai::readonly_context_proxy::unit_stats_cache ( ) const
inlineoverridevirtual

Member Data Documentation

◆ target_

readonly_context* ai::readonly_context_proxy::target_
private

Definition at line 872 of file contexts.hpp.

Referenced by add_aspects(), add_facet(), best_defensive_position(), calculate_moves(), calculate_possible_moves(), check_attack_action(), check_move_action(), check_recall_action(), check_recruit_action(), check_stopunit_action(), check_synced_command_action(), current_team(), defensive_position_cache(), diagnostic(), get_advancements(), get_aggression(), get_allow_ally_villages(), get_aspects(), get_attacks(), get_attacks_as_variant(), get_avoid(), get_caution(), get_dstsrc(), get_enemy_dstsrc(), get_enemy_possible_moves(), get_enemy_srcdst(), get_engine_by_cfg(), get_engines(), get_goals(), get_grouping(), get_info(), get_leader_aggression(), get_leader_goal(), get_leader_ignores_keep(), get_leader_value(), get_passive_leader(), get_passive_leader_shares_keep(), get_possible_moves(), get_readonly_context(), get_recruitment_diversity(), get_recruitment_instructions(), get_recruitment_more(), get_recruitment_pattern(), get_recruitment_randomness(), get_recruitment_save_gold(), get_recursion_count(), get_retreat_enemy_weight(), get_retreat_factor(), get_scout_village_targeting(), get_simple_targeting(), get_srcdst(), get_support_villages(), get_village_value(), get_villages_per_scout(), init_readonly_context_proxy(), invalidate_defensive_position_cache(), invalidate_keeps_cache(), invalidate_move_maps(), is_active(), is_dst_src_enemy_valid_lua(), is_dst_src_valid_lua(), is_keep_ignoring_leader(), is_passive_keep_sharing_leader(), is_passive_leader(), is_src_dst_enemy_valid_lua(), is_src_dst_valid_lua(), keeps(), leader_can_reach_keep(), log_message(), nearest_keep(), on_readonly_context_create(), power_projection(), raise_user_interact(), recalculate_move_maps(), recalculate_move_maps_enemy(), set_dst_src_enemy_valid_lua(), set_dst_src_valid_lua(), set_src_dst_enemy_valid_lua(), set_src_dst_valid_lua(), suitable_keep(), to_readonly_context_config(), and unit_stats_cache().


The documentation for this class was generated from the following file: