#include <actions.hpp>
Public Types | |
enum | result { E_EMPTY_ATTACKER = 1001 , E_EMPTY_DEFENDER = 1002 , E_INCAPACITATED_ATTACKER = 1003 , E_INCAPACITATED_DEFENDER = 1004 , E_NOT_OWN_ATTACKER = 1005 , E_NOT_ENEMY_DEFENDER = 1006 , E_NO_ATTACKS_LEFT = 1007 , E_WRONG_ATTACKER_WEAPON = 1008 , E_UNABLE_TO_CHOOSE_ATTACKER_WEAPON = 1009 , E_ATTACKER_AND_DEFENDER_NOT_ADJACENT = 1010 } |
Public Types inherited from ai::action_result | |
enum | result { AI_ACTION_SUCCESS = 0 , AI_ACTION_STARTED = 1 , AI_ACTION_FAILURE = -1 } |
Public Member Functions | |
attack_result (side_number side, const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon, double aggression) | |
virtual std::string | do_describe () const |
Public Member Functions inherited from ai::action_result | |
virtual | ~action_result () |
void | check_before () |
void | execute () |
bool | is_gamestate_changed () const |
bool | is_ok () |
int | get_status () const |
Protected Member Functions | |
virtual void | do_check_before () |
virtual void | do_check_after () |
virtual void | do_execute () |
virtual void | do_init_for_execution () |
Protected Member Functions inherited from ai::action_result | |
action_result (side_number side) | |
bool | is_execution () const |
int | get_side () const |
game_info & | get_info () const |
team & | get_my_team () const |
void | set_error (int error_code, bool log_as_error=true) |
bool | is_success () const |
void | set_gamestate_changed () |
Private Attributes | |
const map_location & | attacker_loc_ |
const map_location & | defender_loc_ |
int | attacker_weapon_ |
double | aggression_ |
Definition at line 129 of file actions.hpp.
Definition at line 137 of file actions.hpp.
ai::attack_result::attack_result | ( | side_number | side, |
const map_location & | attacker_loc, | ||
const map_location & | defender_loc, | ||
int | attacker_weapon, | ||
double | aggression | ||
) |
Definition at line 175 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 245 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 180 of file actions.cpp.
References attacker_loc_, attacker_weapon_, defender_loc_, E_ATTACKER_AND_DEFENDER_NOT_ADJACENT, E_EMPTY_ATTACKER, E_EMPTY_DEFENDER, E_INCAPACITATED_ATTACKER, E_INCAPACITATED_DEFENDER, E_NO_ATTACKS_LEFT, E_NOT_ENEMY_DEFENDER, E_NOT_OWN_ATTACKER, E_WRONG_ATTACKER_WEAPON, unit_map::find(), resources::gameboard, ai::action_result::get_my_team(), ai::action_result::get_side(), LOG_AI_ACTIONS, ai::action_result::set_error(), tiles_adjacent(), and game_board::units().
|
virtual |
Implements ai::action_result.
Definition at line 249 of file actions.cpp.
References aggression_, attacker_loc_, attacker_weapon_, defender_loc_, ai::action_result::get_side(), and s.
Referenced by operator<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 262 of file actions.cpp.
References a_, aggression_, battle_context_unit_stats::attack_num, attacker_loc_, attacker_weapon_, combatant::average_hp(), DBG_AI_ACTIONS, defender_loc_, E_UNABLE_TO_CHOOSE_ATTACKER_WEAPON, unit_map::find(), resources::gameboard, replay_helper::get_attack(), battle_context::get_attacker_combatant(), battle_context::get_attacker_stats(), battle_context::get_defender_combatant(), battle_context::get_defender_stats(), ai::action_result::get_info(), ai::manager::get_singleton(), tod_manager::get_time_of_day(), ai::action_result::is_ok(), LOG_AI_ACTIONS, ai::manager::raise_gamestate_changed(), ai::game_info::recent_attacks, synced_context::run_in_synced_context_if_not_already(), ai::action_result::set_error(), ai::action_result::set_gamestate_changed(), ai::action_result::sim_gamestate_changed, ai::simulated_attack(), resources::simulation_, resources::tod_manager, tod_manager::turn(), and game_board::units().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 317 of file actions.cpp.
|
private |
Definition at line 160 of file actions.hpp.
Referenced by do_describe(), and do_execute().
|
private |
Definition at line 157 of file actions.hpp.
Referenced by do_check_before(), do_describe(), and do_execute().
|
private |
Definition at line 159 of file actions.hpp.
Referenced by do_check_before(), do_describe(), and do_execute().
|
private |
Definition at line 158 of file actions.hpp.
Referenced by do_check_before(), do_describe(), and do_execute().