#include <actions.hpp>
Public Types | |
enum | result { E_NO_UNIT = 4002 , E_NOT_OWN_UNIT = 4003 , E_INCAPACITATED_UNIT = 4004 } |
Public Types inherited from ai::action_result | |
enum | result { 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 |
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 Member Functions | |
const unit * | get_unit () |
Private Attributes | |
const map_location & | unit_location_ |
const bool | remove_movement_ |
const bool | remove_attacks_ |
Definition at line 267 of file actions.hpp.
Enumerator | |
---|---|
E_NO_UNIT | |
E_NOT_OWN_UNIT | |
E_INCAPACITATED_UNIT |
Definition at line 274 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 810 of file actions.cpp.
|
protectedvirtual |
Implements ai::action_result.
Definition at line 843 of file actions.cpp.
References ai::action_result::AI_ACTION_FAILURE, unit_map::find(), resources::gameboard, remove_attacks_, remove_movement_, ai::action_result::set_error(), unit_location_, and game_board::units().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 834 of file actions.cpp.
References get_unit(), and LOG_AI_ACTIONS.
|
virtual |
Implements ai::action_result.
Definition at line 860 of file actions.cpp.
References ai::action_result::get_side(), remove_attacks_, remove_movement_, s, and unit_location_.
Referenced by operator<<().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 879 of file actions.cpp.
References DBG_AI_ACTIONS, unit_map::find(), resources::gameboard, ai::manager::get_singleton(), 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 game_board::units().
|
protectedvirtual |
Implements ai::action_result.
Definition at line 912 of file actions.cpp.
|
private |
Definition at line 815 of file actions.cpp.
References E_INCAPACITATED_UNIT, E_NO_UNIT, E_NOT_OWN_UNIT, unit_map::find(), resources::gameboard, ai::action_result::get_side(), unit::incapacitated(), ai::action_result::set_error(), unit::side(), unit_location_, and game_board::units().
Referenced by do_check_before().
|
private |
Definition at line 290 of file actions.hpp.
Referenced by do_check_after(), do_describe(), and do_execute().
|
private |
Definition at line 289 of file actions.hpp.
Referenced by do_check_after(), do_describe(), and do_execute().
|
private |
Definition at line 288 of file actions.hpp.
Referenced by do_check_after(), do_describe(), do_execute(), and get_unit().