#include <actions.hpp>
Public Types | |
enum | tresult { 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 | tresult { 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, const unit_advancements_aspect &advancements=unit_advancements_aspect()) | |
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_ |
const unit_advancements_aspect & | advancements_ |
Definition at line 131 of file actions.hpp.
Definition at line 140 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, | ||
const unit_advancements_aspect & | advancements = unit_advancements_aspect() |
||
) |
Definition at line 173 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 242 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 177 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(), ai::action_result::get_my_team(), ai::action_result::get_side(), LOG_AI_ACTIONS, ai::action_result::set_error(), tiles_adjacent(), and resources::units.
|
virtual |
Implements ai::action_result.
Definition at line 246 of file actions.cpp.
References aggression_, attacker_loc_, attacker_weapon_, defender_loc_, and ai::action_result::get_side().
Referenced by operator<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 259 of file actions.cpp.
References a_, replay::add_synced_command(), advancements_, aggression_, battle_context_unit_stats::attack_num, attack_unit_and_advance(), attacker_loc_, attacker_weapon_, combatant::average_hp(), play_controller::check_victory(), resources::controller, DBG_AI_ACTIONS, defender_loc_, set_scontext_synced::do_final_checkup(), E_UNABLE_TO_CHOOSE_ATTACKER_WEAPON, unit_map::find(), 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(), tod_manager::get_time_of_day(), ai::action_result::is_ok(), synced_context::is_synced(), LOG_AI_ACTIONS, play_controller::maybe_throw_return_to_play_side(), ai::manager::raise_gamestate_changed(), ai::game_info::recent_attacks, resources::recorder, 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 resources::units.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 320 of file actions.cpp.
|
private |
Definition at line 164 of file actions.hpp.
Referenced by do_execute().
|
private |
Definition at line 163 of file actions.hpp.
Referenced by do_describe(), and do_execute().
|
private |
Definition at line 160 of file actions.hpp.
Referenced by do_check_before(), do_describe(), and do_execute().
|
private |
Definition at line 162 of file actions.hpp.
Referenced by do_check_before(), do_describe(), and do_execute().
|
private |
Definition at line 161 of file actions.hpp.
Referenced by do_check_before(), do_describe(), and do_execute().