#include <actions.hpp>
Public Types | |
enum | tresult { E_NO_UNIT = 4002, E_NOT_OWN_UNIT = 4003, E_INCAPACITATED_UNIT = 4004 } |
![]() | |
enum | tresult { AI_ACTION_SUCCESS = 0, AI_ACTION_STARTED = 1, AI_ACTION_FAILURE = -1 } |
Public Member Functions | |
stopunit_result (side_number side, const map_location &unit_location, bool remove_movement, bool remove_attacks) | |
virtual std::string | do_describe () const |
![]() | |
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 () |
![]() | |
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 Member Functions | |
const unit * | get_unit () |
Private Attributes | |
const map_location & | unit_location_ |
const bool | remove_movement_ |
const bool | remove_attacks_ |
Definition at line 271 of file actions.hpp.
Enumerator | |
---|---|
E_NO_UNIT | |
E_NOT_OWN_UNIT | |
E_INCAPACITATED_UNIT |
Definition at line 278 of file actions.hpp.
ai::stopunit_result::stopunit_result | ( | side_number | side, |
const map_location & | unit_location, | ||
bool | remove_movement, | ||
bool | remove_attacks | ||
) |
Definition at line 826 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 859 of file actions.cpp.
References ai::action_result::AI_ACTION_FAILURE, unit_map::find(), remove_attacks_, remove_movement_, ai::action_result::set_error(), unit_location_, and resources::units.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 850 of file actions.cpp.
References get_unit(), and LOG_AI_ACTIONS.
|
virtual |
Implements ai::action_result.
Definition at line 876 of file actions.cpp.
References ai::action_result::get_side(), remove_attacks_, remove_movement_, and unit_location_.
Referenced by operator<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 895 of file actions.cpp.
References DBG_AI_ACTIONS, unit_map::find(), ai::action_result::is_ok(), ai::action_result::is_success(), LOG_AI_ACTIONS, ai::manager::raise_gamestate_changed(), remove_attacks_, remove_movement_, ai::action_result::set_gamestate_changed(), ai::action_result::sim_gamestate_changed, ai::simulated_stopunit(), resources::simulation_, unit_location_, and resources::units.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 926 of file actions.cpp.
|
private |
Definition at line 831 of file actions.cpp.
References E_INCAPACITATED_UNIT, E_NO_UNIT, E_NOT_OWN_UNIT, unit_map::find(), ai::action_result::get_side(), unit::incapacitated(), ai::action_result::set_error(), unit::side(), unit_location_, and resources::units.
Referenced by do_check_before().
|
private |
Definition at line 294 of file actions.hpp.
Referenced by do_check_after(), do_describe(), and do_execute().
|
private |
Definition at line 293 of file actions.hpp.
Referenced by do_check_after(), do_describe(), and do_execute().
|
private |
Definition at line 292 of file actions.hpp.
Referenced by do_check_after(), do_describe(), do_execute(), and get_unit().