#include <ca.hpp>


Public Member Functions | |
| retreat_phase (rca_context &context, const config &cfg) | |
| virtual | ~retreat_phase () |
| virtual double | evaluate () |
| Evaluate the candidate action, resetting the internal state of the action. | |
| virtual void | execute () |
| Execute the candidate action. | |
Private Member Functions | |
| bool | should_retreat (const map_location &loc, const unit_map::const_iterator &un, const move_map &srcdst, const move_map &dstsrc, double caution) |
Private Attributes | |
| move_result_ptr | move_ |
Definition at line 284 of file ca.hpp.
| ai::testing_ai_default::retreat_phase::retreat_phase | ( | rca_context & | context, | |
| const config & | cfg | |||
| ) |
| ai::testing_ai_default::retreat_phase::~retreat_phase | ( | ) | [virtual] |
| double ai::testing_ai_default::retreat_phase::evaluate | ( | ) | [virtual] |
Evaluate the candidate action, resetting the internal state of the action.
| >0 | if the action is good | |
| <=0 | if the action is not good |
Implements ai::candidate_action.
Definition at line 1709 of file ca.cpp.
References ai::candidate_action::BAD_SCORE, unit_map::begin(), ai::readonly_context_proxy::calculate_possible_moves(), ai::readonly_context_proxy::check_move_action(), unit_map::end(), gui2::event::find(), unit_map::find_leaders(), resources::game_map, get_adjacent_tiles(), ai::readonly_context_proxy::get_avoid(), ai::readonly_context_proxy::get_caution(), ai::readonly_context_proxy::get_dstsrc(), ai::readonly_context_proxy::get_enemy_dstsrc(), ai::candidate_action::get_score(), ai::side_context_proxy::get_side(), ai::readonly_context_proxy::get_srcdst(), gamemap::is_village(), move_, ai::readonly_context_proxy::power_projection(), should_retreat(), resources::units, and map_location::valid().

| void ai::testing_ai_default::retreat_phase::execute | ( | ) | [virtual] |
Execute the candidate action.
Implements ai::candidate_action.
Definition at line 1832 of file ca.cpp.
References ai::candidate_action::get_name(), LOG_AI_TESTING_AI_DEFAULT, and move_.

| bool ai::testing_ai_default::retreat_phase::should_retreat | ( | const map_location & | loc, | |
| const unit_map::const_iterator & | un, | |||
| const move_map & | srcdst, | |||
| const move_map & | dstsrc, | |||
| double | caution | |||
| ) | [private] |
Definition at line 1842 of file ca.cpp.
References ai::readonly_context_proxy::best_defensive_position(), resources::game_map, ai::readonly_context_proxy::get_enemy_dstsrc(), and ai::readonly_context_proxy::power_projection().
Referenced by evaluate().


Definition at line 298 of file ca.hpp.
Referenced by evaluate(), and execute().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:19:09 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |