#include <contexts.hpp>
Public Member Functions | |
readonly_context_impl (side_context &context, const config &cfg) | |
Constructor. More... | |
virtual | ~readonly_context_impl () |
Destructor. More... | |
virtual readonly_context & | get_readonly_context () |
Unwrap - this class is not a proxy, so return *this :w More... | |
virtual void | on_readonly_context_create () |
virtual void | handle_generic_event (const std::string &event_name) |
Handle generic event. More... | |
const team & | current_team () const |
Return a reference to the 'team' object for the AI. More... | |
void | diagnostic (const std::string &msg) |
Show a diagnostic message on the screen. More... | |
void | log_message (const std::string &msg) |
Display a debug message as a chat message. More... | |
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 location,. More... | |
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'. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual const game_info & | get_info () const |
void | raise_user_interact () const |
Function which should be called frequently to allow the user to interact with the interface. More... | |
virtual int | get_recursion_count () const |
Get the value of the recursion counter. More... | |
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 std::map< map_location, defensive_position > & | defensive_position_cache () const |
virtual const unit_advancements_aspect & | get_advancements () const |
virtual double | get_aggression () const |
virtual int | get_attack_depth () const |
virtual const aspect_map & | get_aspects () const |
virtual aspect_map & | get_aspects () |
virtual const attacks_vector & | get_attacks () const |
virtual const variant & | get_attacks_as_variant () const |
virtual const terrain_filter & | get_avoid () const |
virtual double | get_caution () const |
virtual const move_map & | get_dstsrc () const |
virtual const move_map & | get_enemy_dstsrc () const |
virtual const moves_map & | get_enemy_possible_moves () const |
virtual const move_map & | get_enemy_srcdst () const |
virtual engine_ptr | get_engine_by_cfg (const config &cfg) |
get engine by cfg, creating it if it is not created yet but known More... | |
virtual const std::vector < engine_ptr > & | get_engines () const |
virtual std::vector< engine_ptr > & | get_engines () |
virtual std::string | get_grouping () const |
virtual const std::vector < goal_ptr > & | get_goals () const |
virtual std::vector< goal_ptr > & | get_goals () |
virtual double | get_leader_aggression () const |
virtual config | get_leader_goal () const |
virtual bool | get_leader_ignores_keep () const |
virtual double | get_leader_value () const |
virtual bool | get_passive_leader () const |
virtual bool | get_passive_leader_shares_keep () const |
virtual const moves_map & | get_possible_moves () const |
virtual const std::vector < unit_ptr > & | get_recall_list () const |
virtual double | get_recruitment_diversity () const |
virtual const config | get_recruitment_instructions () const |
virtual const std::vector < std::string > | get_recruitment_more () const |
virtual const std::vector < std::string > | get_recruitment_pattern () const |
virtual int | get_recruitment_randomness () const |
virtual const config | get_recruitment_save_gold () const |
virtual double | get_scout_village_targeting () const |
virtual bool | get_simple_targeting () const |
virtual const move_map & | get_srcdst () const |
virtual bool | get_support_villages () const |
virtual double | get_village_value () const |
virtual int | get_villages_per_scout () const |
virtual bool | is_active (const std::string &time_of_day, const std::string &turns) const |
virtual bool | is_dst_src_valid_lua () const |
virtual bool | is_dst_src_enemy_valid_lua () const |
virtual bool | is_src_dst_valid_lua () const |
virtual bool | is_src_dst_enemy_valid_lua () const |
virtual void | invalidate_defensive_position_cache () const |
virtual void | invalidate_move_maps () const |
virtual void | invalidate_keeps_cache () const |
virtual const std::set < map_location > & | keeps () const |
virtual bool | leader_can_reach_keep () const |
virtual const map_location & | nearest_keep (const map_location &loc) 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. More... | |
virtual void | recalculate_move_maps () const |
virtual void | recalculate_move_maps_enemy () const |
virtual void | add_aspects (std::vector< aspect_ptr > &aspects) |
virtual void | add_facet (const std::string &id, const config &cfg) const |
void | on_create () |
virtual void | set_dst_src_valid_lua () |
virtual void | set_dst_src_enemy_valid_lua () |
virtual void | set_src_dst_valid_lua () |
virtual void | set_src_dst_enemy_valid_lua () |
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 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 |
serialize to config More... | |
virtual unit_stats_cache_t & | unit_stats_cache () const |
Weapon choice cache, to speed simulations. 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 |
Get the side number. More... | |
virtual void | set_side (side_number side) |
Set the side number. More... | |
virtual side_context & | get_side_context () |
unwrap More... | |
virtual config | to_side_context_config () const |
serialize this context to config More... | |
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::readonly_context | |
readonly_context () | |
virtual | ~readonly_context () |
Public Member Functions inherited from events::observer | |
virtual | ~observer () |
Private Member Functions | |
template<typename T > | |
void | add_known_aspect (const std::string &name, boost::shared_ptr< typesafe_aspect< T > > &where) |
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 |
Definition at line 1135 of file contexts.hpp.
ai::readonly_context_impl::readonly_context_impl | ( | side_context & | context, |
const config & | cfg | ||
) |
Constructor.
Definition at line 188 of file contexts.cpp.
References ai::manager::add_gamestate_observer(), add_known_aspect(), advancements_, aggression_, attack_depth_, attacks_, avoid_, caution_, resources::gameboard, grouping_, ai::keeps_cache::init(), ai::side_context_proxy::init_side_context_proxy(), keeps_, leader_aggression_, leader_goal_, leader_ignores_keep_, leader_value_, passive_leader_, passive_leader_shares_keep_, recruitment_diversity_, recruitment_instructions_, recruitment_more_, recruitment_pattern_, recruitment_randomness_, recruitment_save_gold_, scout_village_targeting_, simple_targeting_, support_villages_, village_value_, and villages_per_scout_.
|
virtual |
Destructor.
Definition at line 311 of file contexts.cpp.
References ai::manager::remove_gamestate_observer().
|
virtual |
Implements ai::readonly_context.
Definition at line 459 of file contexts.cpp.
References ERR_AI, i, and known_aspects_.
Referenced by on_readonly_context_create().
|
virtual |
Implements ai::readonly_context.
Definition at line 472 of file contexts.cpp.
References ERR_AI, i, and known_aspects_.
|
private |
Definition at line 182 of file contexts.cpp.
References aspects_, and known_aspects_.
Referenced by readonly_context_impl().
|
virtual |
Implements ai::readonly_context.
Definition at line 482 of file contexts.cpp.
References ai::defensive_position::chance_to_hit, defensive_position_cache_, unit_map::find(), resources::gameboard, i, itor, ai::defensive_position::loc, pos, power_projection(), ai::defensive_position::support, resources::units, and ai::defensive_position::vulnerability.
|
virtual |
A more fundamental version of calculate_possible_moves which allows the use of a speculative unit map.
NOTE: Support for a speculative map is broken (not used when pathfinding) and has not been used since (probably) r38610 (September 2009). (See the todo in the implementation.)
Implements ai::readonly_context.
Definition at line 361 of file contexts.cpp.
References unit_map::begin(), pathfind::paths::step::curr, current_team(), unit_map::end(), resources::gameboard, ai::side_context_proxy::get_side(), team::is_enemy(), terrain_filter::match(), resources::teams, terrain_filter::to_config(), and resources::units.
Referenced by calculate_possible_moves().
|
virtual |
Calculate the moves units may possibly make.
possible_moves | A map which will be filled with the paths each unit can take to get to every possible destination. You probably don't want to use this object at all, except to pass to 'move_unit'. |
srcdst | A map of units to all their possible destinations. |
dstsrc | A map of destinations to all the units that can move to that destination. |
enemy | if true, a map of possible moves for enemies will be calculated. If false, a map of possible moves for units on the AI's side will be calculated. The AI's own leader will not be included in this map. |
assume_full_movement | If true, the function will operate on the assumption that all units can move their full movement allotment. |
remove_destinations | a pointer to a terrain filter for possible destinations to omit. |
Implements ai::readonly_context.
Definition at line 354 of file contexts.cpp.
References calculate_moves(), and resources::units.
Referenced by recalculate_move_maps(), and recalculate_move_maps_enemy().
|
virtual |
Check if it is possible to attack enemy defender using our unit attacker from attackers current location,.
attacker_loc | location of attacker |
defender_loc | location of defender |
attacker_weapon | weapon of attacker |
possible | result: ok |
possible | result: something wrong |
possible | result: attacker and/or defender are invalid |
possible | result: attacker and/or defender are invalid |
possible | result: attacker doesn't have the specified weapon |
Implements ai::readonly_context.
Definition at line 123 of file contexts.cpp.
References ai::actions::execute_attack_action(), unit_map::find(), get_advancements(), get_aggression(), get_leader_aggression(), ai::side_context_proxy::get_side(), i, resources::units, and unit_map::iterator_base< iter_types >::valid().
|
virtual |
Check if it is possible to move our unit from location 'from' to location 'to'.
from | location of our unit |
to | where to move |
remove_movement | set unit movement to 0 in case of successful move |
possible | result: ok |
possible | result: something wrong |
possible | result: move is interrupted |
possible | result: move is impossible |
Implements ai::readonly_context.
Definition at line 136 of file contexts.cpp.
References ai::actions::execute_move_action(), and ai::side_context_proxy::get_side().
|
virtual |
Check if it is possible to recall a unit for us on specified location.
id | the id of the unit to be recruited. |
where | location where the unit is to be recruited. |
possible | result: ok |
possible_result | something wrong |
possible_result | leader not on keep |
possible_result | no free space on keep |
possible_result | not enough gold |
Implements ai::readonly_context.
Definition at line 151 of file contexts.cpp.
References ai::actions::execute_recall_action(), and ai::side_context_proxy::get_side().
|
virtual |
Check if it is possible to recruit a unit for us on specified location.
unit_name | the name of the unit to be recruited. |
where | location where the unit is to be recruited. |
possible | result: ok |
possible_result | something wrong |
possible_result | leader not on keep |
possible_result | no free space on keep |
possible_result | not enough gold |
Implements ai::readonly_context.
Definition at line 156 of file contexts.cpp.
References ai::actions::execute_recruit_action(), and ai::side_context_proxy::get_side().
|
virtual |
Check if it is possible to remove unit movements and/or attack.
unit_location | the location of our unit |
remove_movement | set remaining movements to 0 |
remove_attacks | set remaining attacks to 0 |
possible | result: ok |
possible_result | something wrong |
possible_result | nothing to do |
Implements ai::readonly_context.
Definition at line 166 of file contexts.cpp.
References ai::actions::execute_stopunit_action(), and ai::side_context_proxy::get_side().
|
virtual |
Check if it is possible to run Lua code.
lua_code | the code to be run |
location | location to be passed to the code as x1/y1 |
possible | result: ok |
possible_result | something wrong |
possible_result | nothing to do |
Implements ai::readonly_context.
Definition at line 176 of file contexts.cpp.
References ai::actions::execute_synced_command_action(), and ai::side_context_proxy::get_side().
|
virtual |
Return a reference to the 'team' object for the AI.
Implements ai::readonly_context.
Definition at line 339 of file contexts.cpp.
References ai::side_context_proxy::get_side(), and resources::teams.
Referenced by calculate_moves(), get_recall_list(), and leader_can_reach_keep().
|
virtual |
Implements ai::readonly_context.
Definition at line 529 of file contexts.cpp.
References defensive_position_cache_.
|
virtual |
Show a diagnostic message on the screen.
Implements ai::readonly_context.
Definition at line 331 of file contexts.cpp.
References game_config::debug, resources::screen, and display::set_diagnostic().
|
virtual |
Implements ai::readonly_context.
Definition at line 535 of file contexts.cpp.
References advancements_.
Referenced by check_attack_action().
|
virtual |
Implements ai::readonly_context.
Definition at line 546 of file contexts.cpp.
References aggression_.
Referenced by check_attack_action().
|
virtual |
|
virtual |
|
virtual |
Implements ai::readonly_context.
Definition at line 555 of file contexts.cpp.
References attack_depth_.
|
virtual |
|
virtual |
Implements ai::readonly_context.
Definition at line 586 of file contexts.cpp.
References attacks_.
|
virtual |
Implements ai::readonly_context.
Definition at line 595 of file contexts.cpp.
References config::add_child(), avoid_, and resources::filter_con.
Referenced by nearest_keep(), and recalculate_move_maps().
|
virtual |
|
virtual |
Implements ai::readonly_context.
Definition at line 615 of file contexts.cpp.
References dstsrc_, move_maps_valid_, and recalculate_move_maps().
|
virtual |
Implements ai::readonly_context.
Definition at line 624 of file contexts.cpp.
References enemy_dstsrc_, move_maps_enemy_valid_, and recalculate_move_maps_enemy().
|
virtual |
Implements ai::readonly_context.
Definition at line 633 of file contexts.cpp.
References enemy_possible_moves_, move_maps_enemy_valid_, and recalculate_move_maps_enemy().
|
virtual |
Implements ai::readonly_context.
Definition at line 642 of file contexts.cpp.
References enemy_srcdst_, move_maps_enemy_valid_, and recalculate_move_maps_enemy().
|
virtual |
get engine by cfg, creating it if it is not created yet but known
Implements ai::readonly_context.
Definition at line 651 of file contexts.cpp.
References DBG_AI, engines_, ERR_AI, ai::engine_factory::get_list(), and ai::side_context_proxy::get_side().
|
virtual |
|
virtual |
|
virtual |
Implements ai::readonly_context.
Definition at line 709 of file contexts.cpp.
References goals_.
Referenced by on_readonly_context_create().
|
virtual |
|
virtual |
|
virtual |
Implements ai::readonly_context.
Definition at line 322 of file contexts.cpp.
References ai::manager::get_active_ai_info_for_side(), and ai::side_context_proxy::get_side().
|
virtual |
Implements ai::readonly_context.
Definition at line 722 of file contexts.cpp.
References leader_aggression_.
Referenced by check_attack_action().
|
virtual |
Implements ai::readonly_context.
Definition at line 731 of file contexts.cpp.
References leader_goal_.
|
virtual |
Implements ai::readonly_context.
Definition at line 740 of file contexts.cpp.
References leader_ignores_keep_.
|
virtual |
Implements ai::readonly_context.
Definition at line 749 of file contexts.cpp.
References leader_value_.
|
virtual |
Implements ai::readonly_context.
Definition at line 758 of file contexts.cpp.
References passive_leader_.
Referenced by recalculate_move_maps().
|
virtual |
Implements ai::readonly_context.
Definition at line 767 of file contexts.cpp.
References passive_leader_shares_keep_.
Referenced by recalculate_move_maps().
|
virtual |
Implements ai::readonly_context.
Definition at line 776 of file contexts.cpp.
References move_maps_valid_, possible_moves_, and recalculate_move_maps().
|
inlinevirtual |
Unwrap - this class is not a proxy, so return *this
:w
Implements ai::readonly_context.
Definition at line 1154 of file contexts.hpp.
|
virtual |
Implements ai::readonly_context.
Definition at line 785 of file contexts.cpp.
References current_team(), team::recall_list(), and recall_list_manager::recall_list_.
|
virtual |
Implements ai::readonly_context.
Definition at line 792 of file contexts.cpp.
References recruitment_diversity_.
|
virtual |
Implements ai::readonly_context.
Definition at line 801 of file contexts.cpp.
References recruitment_instructions_.
|
virtual |
Implements ai::readonly_context.
Definition at line 810 of file contexts.cpp.
References recruitment_more_.
|
virtual |
Implements ai::readonly_context.
Definition at line 819 of file contexts.cpp.
References recruitment_pattern_.
|
virtual |
Implements ai::readonly_context.
Definition at line 828 of file contexts.cpp.
References recruitment_randomness_.
|
virtual |
Implements ai::readonly_context.
Definition at line 837 of file contexts.cpp.
References recruitment_save_gold_.
|
virtual |
Get the value of the recursion counter.
Reimplemented from ai::side_context_proxy.
Definition at line 86 of file contexts.cpp.
References ai::recursion_counter::get_count(), and recursion_counter_.
|
virtual |
Implements ai::readonly_context.
Definition at line 846 of file contexts.cpp.
References scout_village_targeting_.
|
virtual |
Implements ai::readonly_context.
Definition at line 855 of file contexts.cpp.
References simple_targeting_.
|
virtual |
Implements ai::readonly_context.
Definition at line 864 of file contexts.cpp.
References move_maps_valid_, recalculate_move_maps(), and srcdst_.
|
virtual |
Implements ai::readonly_context.
Definition at line 873 of file contexts.cpp.
References support_villages_.
|
virtual |
Implements ai::readonly_context.
Definition at line 882 of file contexts.cpp.
References village_value_.
|
virtual |
Implements ai::readonly_context.
Definition at line 891 of file contexts.cpp.
References villages_per_scout_.
|
virtual |
Handle generic event.
Implements events::observer.
Definition at line 316 of file contexts.cpp.
References invalidate_move_maps().
|
virtual |
Implements ai::readonly_context.
Definition at line 920 of file contexts.cpp.
References defensive_position_cache_.
|
virtual |
Implements ai::readonly_context.
Definition at line 926 of file contexts.cpp.
References ai::keeps_cache::clear(), and keeps_.
|
virtual |
Implements ai::readonly_context.
Definition at line 938 of file contexts.cpp.
References dst_src_enemy_valid_lua_, dst_src_valid_lua_, move_maps_enemy_valid_, move_maps_valid_, src_dst_enemy_valid_lua_, and src_dst_valid_lua_.
Referenced by handle_generic_event().
|
virtual |
Implements ai::readonly_context.
Definition at line 1286 of file contexts.cpp.
References tod_manager::get_time_of_day(), time_of_day::id, utils::parse_range(), utils::split(), resources::tod_manager, and tod_manager::turn().
|
virtual |
Implements ai::readonly_context.
Definition at line 905 of file contexts.cpp.
References dst_src_enemy_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 900 of file contexts.cpp.
References dst_src_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 915 of file contexts.cpp.
References src_dst_enemy_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 910 of file contexts.cpp.
References src_dst_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 951 of file contexts.cpp.
References ai::keeps_cache::get(), and keeps_.
Referenced by nearest_keep(), and suitable_keep().
|
virtual |
Implements ai::readonly_context.
Definition at line 1009 of file contexts.cpp.
References pathfind::paths::dest_vect::contains(), current_team(), pathfind::paths::destinations, unit_map::find_leader(), ai::side_context_proxy::get_side(), nearest_keep(), resources::units, and map_location::valid().
|
virtual |
Display a debug message as a chat message.
Implements ai::readonly_context.
Definition at line 345 of file contexts.cpp.
References display_chat_manager::add_chat_message(), game_config::debug, game_display::get_chat_manager(), ai::side_context_proxy::get_side(), events::chat_handler::MESSAGE_PUBLIC, and resources::screen.
|
virtual |
Implements ai::readonly_context.
Definition at line 1032 of file contexts.cpp.
References distance_between(), get_avoid(), terrain_filter::get_locations(), i, keeps(), and map_location::null_location().
Referenced by leader_can_reach_keep(), and suitable_keep().
void ai::readonly_context_impl::on_create | ( | ) |
|
virtual |
Implements ai::readonly_context.
Definition at line 265 of file contexts.cpp.
References add_aspects(), cfg_, config::child_range(), engines_, get_goals(), ai::engine::parse_aspect_from_config(), ai::engine::parse_engine_from_config(), and ai::engine::parse_goal_from_config().
|
virtual |
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 1062 of file contexts.cpp.
References unit::alignment(), unit::attacks(), unit::defense_modifier(), unit_map::end(), gui2::event::find(), unit_map::find(), resources::gameboard, get_adjacent_tiles(), ai::side_context_proxy::get_side(), tod_manager::get_time_of_day(), unit::hitpoints(), i, int(), gamemap::is_village(), time_of_day::lawful_bonus, game_board::map(), map_, unit::max_hitpoints(), gamemap::on_board(), pos, unit::side(), gui2::terrain, resources::tod_manager, tod_manager::turn(), resources::units, units_, and map_location::valid().
Referenced by best_defensive_position().
|
virtual |
Function which should be called frequently to allow the user to interact with the interface.
This function will make sure that interaction doesn't occur too often, so there is no problem with calling it very regularly.
Implements ai::readonly_context.
Definition at line 98 of file contexts.cpp.
References ai::manager::raise_user_interact().
|
virtual |
Implements ai::readonly_context.
Definition at line 1174 of file contexts.cpp.
References calculate_possible_moves(), dst_src_valid_lua_, dstsrc_, unit_map::find_leader(), get_avoid(), get_passive_leader(), get_passive_leader_shares_keep(), ai::side_context_proxy::get_side(), i, move_maps_valid_, possible_moves_, src_dst_valid_lua_, srcdst_, resources::units, and unit_map::iterator_base< iter_types >::valid().
Referenced by get_dstsrc(), get_possible_moves(), and get_srcdst().
|
virtual |
Implements ai::readonly_context.
Definition at line 1203 of file contexts.cpp.
References calculate_possible_moves(), dst_src_enemy_valid_lua_, enemy_dstsrc_, enemy_possible_moves_, enemy_srcdst_, move_maps_enemy_valid_, and src_dst_enemy_valid_lua_.
Referenced by get_enemy_dstsrc(), get_enemy_possible_moves(), and get_enemy_srcdst().
|
virtual |
Implements ai::readonly_context.
Definition at line 1221 of file contexts.cpp.
References dst_src_enemy_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 1216 of file contexts.cpp.
References dst_src_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 1231 of file contexts.cpp.
References src_dst_enemy_valid_lua_.
|
virtual |
Implements ai::readonly_context.
Definition at line 1226 of file contexts.cpp.
References src_dst_valid_lua_.
|
virtual |
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 1236 of file contexts.cpp.
References pathfind::paths::step::curr, pathfind::paths::destinations, gui2::event::find(), resources::gameboard, keeps(), pathfind::paths::step::move_left, nearest_keep(), map_location::null_location(), and resources::units.
|
virtual |
serialize to config
Implements ai::readonly_context.
Definition at line 296 of file contexts.cpp.
References config::add_child(), aspects_, e, engines_, and goals_.
|
virtual |
Weapon choice cache, to speed simulations.
Implements ai::readonly_context.
Definition at line 1280 of file contexts.cpp.
References unit_stats_cache_.
|
private |
Definition at line 1512 of file contexts.hpp.
Referenced by get_advancements(), and readonly_context_impl().
|
private |
Definition at line 1513 of file contexts.hpp.
Referenced by get_aggression(), and readonly_context_impl().
|
private |
Definition at line 1515 of file contexts.hpp.
Referenced by add_known_aspect(), get_aspects(), and to_readonly_context_config().
|
private |
Definition at line 1514 of file contexts.hpp.
Referenced by get_attack_depth(), and readonly_context_impl().
|
private |
Definition at line 1516 of file contexts.hpp.
Referenced by get_attacks(), get_attacks_as_variant(), and readonly_context_impl().
|
mutableprivate |
Definition at line 1517 of file contexts.hpp.
Referenced by get_avoid(), and readonly_context_impl().
|
private |
Definition at line 1518 of file contexts.hpp.
Referenced by get_caution(), and readonly_context_impl().
|
private |
Definition at line 1503 of file contexts.hpp.
Referenced by on_readonly_context_create().
|
mutableprivate |
Definition at line 1519 of file contexts.hpp.
Referenced by best_defensive_position(), defensive_position_cache(), and invalidate_defensive_position_cache().
|
mutableprivate |
Definition at line 1534 of file contexts.hpp.
Referenced by invalidate_move_maps(), is_dst_src_enemy_valid_lua(), recalculate_move_maps_enemy(), and set_dst_src_enemy_valid_lua().
|
mutableprivate |
Definition at line 1533 of file contexts.hpp.
Referenced by invalidate_move_maps(), is_dst_src_valid_lua(), recalculate_move_maps(), and set_dst_src_valid_lua().
|
mutableprivate |
Definition at line 1520 of file contexts.hpp.
Referenced by get_dstsrc(), and recalculate_move_maps().
|
mutableprivate |
Definition at line 1521 of file contexts.hpp.
Referenced by get_enemy_dstsrc(), and recalculate_move_maps_enemy().
|
mutableprivate |
Definition at line 1522 of file contexts.hpp.
Referenced by get_enemy_possible_moves(), and recalculate_move_maps_enemy().
|
mutableprivate |
Definition at line 1523 of file contexts.hpp.
Referenced by get_enemy_srcdst(), and recalculate_move_maps_enemy().
|
private |
AI Support Engines.
Definition at line 1508 of file contexts.hpp.
Referenced by get_engine_by_cfg(), get_engines(), on_readonly_context_create(), and to_readonly_context_config().
|
private |
Definition at line 1525 of file contexts.hpp.
Referenced by get_goals(), and to_readonly_context_config().
|
private |
Definition at line 1524 of file contexts.hpp.
Referenced by get_grouping(), and readonly_context_impl().
|
mutableprivate |
Definition at line 1526 of file contexts.hpp.
Referenced by invalidate_keeps_cache(), keeps(), and readonly_context_impl().
|
private |
Definition at line 1510 of file contexts.hpp.
Referenced by add_aspects(), add_facet(), and add_known_aspect().
|
private |
Definition at line 1527 of file contexts.hpp.
Referenced by get_leader_aggression(), and readonly_context_impl().
|
private |
Definition at line 1528 of file contexts.hpp.
Referenced by get_leader_goal(), and readonly_context_impl().
|
private |
Definition at line 1529 of file contexts.hpp.
Referenced by get_leader_ignores_keep(), and readonly_context_impl().
|
private |
Definition at line 1530 of file contexts.hpp.
Referenced by get_leader_value(), and readonly_context_impl().
|
mutableprivate |
Definition at line 1531 of file contexts.hpp.
Referenced by get_enemy_dstsrc(), get_enemy_possible_moves(), get_enemy_srcdst(), invalidate_move_maps(), and recalculate_move_maps_enemy().
|
mutableprivate |
Definition at line 1532 of file contexts.hpp.
Referenced by get_dstsrc(), get_possible_moves(), get_srcdst(), invalidate_move_maps(), and recalculate_move_maps().
|
private |
Definition at line 1537 of file contexts.hpp.
Referenced by get_passive_leader(), and readonly_context_impl().
|
private |
Definition at line 1538 of file contexts.hpp.
Referenced by get_passive_leader_shares_keep(), and readonly_context_impl().
|
mutableprivate |
Definition at line 1539 of file contexts.hpp.
Referenced by get_possible_moves(), and recalculate_move_maps().
|
private |
Definition at line 1540 of file contexts.hpp.
Referenced by get_recruitment_diversity(), and readonly_context_impl().
|
private |
Definition at line 1541 of file contexts.hpp.
Referenced by get_recruitment_instructions(), and readonly_context_impl().
|
private |
Definition at line 1542 of file contexts.hpp.
Referenced by get_recruitment_more(), and readonly_context_impl().
|
private |
Definition at line 1543 of file contexts.hpp.
Referenced by get_recruitment_pattern(), and readonly_context_impl().
|
private |
Definition at line 1544 of file contexts.hpp.
Referenced by get_recruitment_randomness(), and readonly_context_impl().
|
private |
Definition at line 1545 of file contexts.hpp.
Referenced by get_recruitment_save_gold(), and readonly_context_impl().
|
private |
Definition at line 1546 of file contexts.hpp.
Referenced by get_recursion_count().
|
private |
Definition at line 1547 of file contexts.hpp.
Referenced by get_scout_village_targeting(), and readonly_context_impl().
|
private |
Definition at line 1548 of file contexts.hpp.
Referenced by get_simple_targeting(), and readonly_context_impl().
|
mutableprivate |
Definition at line 1536 of file contexts.hpp.
Referenced by invalidate_move_maps(), is_src_dst_enemy_valid_lua(), recalculate_move_maps_enemy(), and set_src_dst_enemy_valid_lua().
|
mutableprivate |
Definition at line 1535 of file contexts.hpp.
Referenced by invalidate_move_maps(), is_src_dst_valid_lua(), recalculate_move_maps(), and set_src_dst_valid_lua().
|
mutableprivate |
Definition at line 1549 of file contexts.hpp.
Referenced by get_srcdst(), and recalculate_move_maps().
|
private |
Definition at line 1550 of file contexts.hpp.
Referenced by get_support_villages(), and readonly_context_impl().
|
mutableprivate |
Definition at line 1551 of file contexts.hpp.
Referenced by unit_stats_cache().
|
private |
Definition at line 1552 of file contexts.hpp.
Referenced by get_village_value(), and readonly_context_impl().
|
private |
Definition at line 1553 of file contexts.hpp.
Referenced by get_villages_per_scout(), and readonly_context_impl().