20 #ifndef AI_ACTIONS_HPP_INCLUDED
21 #define AI_ACTIONS_HPP_INCLUDED
97 void set_error(
int error_code,
bool log_as_error =
true);
172 bool remove_movement,
227 const team& my_team);
229 const team& my_team);
275 bool remove_movement,
276 bool remove_attacks );
361 bool remove_movement,
362 bool unreach_is_ok =
false);
419 bool remove_movement,
420 bool remove_attacks );
map_location recruit_location_
map_location recruit_from_
virtual void do_init_for_execution()
virtual void do_check_after()
std::ostream & operator<<(std::ostream &s, ai::attack_result const &r)
virtual void do_execute()
map_location recall_from_
unit_const_ptr get_recall_unit(const team &my_team)
static attack_result_ptr execute_attack_action(side_number side, bool execute, const map_location &attacker_loc, const map_location &defender_loc, int attacker_weapon, double aggression, const unit_advancements_aspect &advancements=unit_advancements_aspect())
Ask the game to attack an enemy defender using our unit attacker from attackers current location...
virtual void do_check_before()
static std::map< int, std::string > error_names_
team & get_my_team() const
virtual void do_execute()=0
map_location unit_location_
virtual void do_init_for_execution()
GLuint GLuint GLsizei GLenum type
virtual void do_check_after()
bool test_route(const unit &un)
map_location recall_location_
virtual void do_init_for_execution()
const map_location & where_
const std::string & unit_id_
const unit_type * get_unit_type_known(const std::string &recruit)
virtual std::string do_describe() const
virtual void do_init_for_execution()
virtual std::string do_describe() const
virtual std::string do_describe() const
virtual void do_check_before()
const unit_advancements_aspect & advancements_
virtual void do_execute()
static config unit_name(const unit *u)
action_result(side_number side)
virtual void do_check_after()=0
const std::string & lua_code_
void init_for_execution()
bool has_interrupted_teleport_
This class stores all the data for a single 'side' (in game nomenclature).
A small explanation about what's going on here: Each action has access to two game_info objects First...
virtual void do_init_for_execution()
static recall_result_ptr execute_recall_action(side_number side, bool execute, const std::string &unit_id, const map_location &where, const map_location &from)
Ask the game to recall a unit for us on specified location.
virtual void do_check_after()
Structure which holds a single route between one location and another.
bool return_value_checked_
bool is_execution() const
virtual void do_check_after()
virtual void do_execute()
Encapsulates the map of the game.
bool test_enough_gold(const team &my_team, const unit_type &type)
synced_command_result(side_number side, const std::string &lua_code, const map_location &location)
virtual void do_check_after()
virtual void do_execute()
const bool remove_movement_
friend void sim_gamestate_changed(action_result *result, bool gamestate_changed)
virtual void do_check_before()=0
virtual void do_init_for_execution()=0
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())
const std::string & unit_name_
virtual std::string do_describe() const
virtual void do_check_before()
Encapsulates the map of the game.
Various functions related to moving units.
const bool remove_attacks_
virtual void do_check_before()
const map_location & defender_loc_
Game information for the AI.
virtual std::string do_describe() const
virtual const map_location & get_unit_location() const
bool test_enough_gold(const team &my_team)
void set_gamestate_changed()
virtual void do_check_before()
static recruit_result_ptr execute_recruit_action(side_number side, bool execute, const std::string &unit_name, const map_location &where, const map_location &from)
Ask the game to recruit a unit for us on specified location.
stopunit_result(side_number side, const map_location &unit_location, bool remove_movement, bool remove_attacks)
static synced_command_result_ptr execute_synced_command_action(side_number side, bool execute, const std::string &lua_code, const map_location &location)
Ask the game to run Lua code.
bool is_gamestate_changed_
virtual std::string do_describe() const
virtual void do_check_before()
GLdouble GLdouble GLdouble r
const map_location & unit_location_
static stopunit_result_ptr execute_stopunit_action(side_number side, bool execute, const map_location &unit_location, bool remove_movement, bool remove_attacks)
Ask the game to remove unit movements and/or attack.
void set_error(int error_code, bool log_as_error=true)
boost::shared_ptr< pathfind::plain_route > route_
bool is_gamestate_changed() const
virtual void do_execute()
virtual std::string do_describe() const =0
recall_result(side_number side, const std::string &unit_id, const map_location &where, const map_location &from)
const map_location where_
const map_location & attacker_loc_
move_result(side_number side, const map_location &from, const map_location &to, bool remove_movement, bool unreach_is_ok)
GLsizei const GLcharARB ** string
virtual void do_check_after()
recruit_result(side_number side, const std::string &unit_name, const map_location &where, const map_location &from)
static move_result_ptr execute_move_action(side_number side, bool execute, const map_location &from, const map_location &to, bool remove_movement, bool unreach_is_ok=false)
Ask the game to move our unit from location 'from' to location 'to', optionally - doing a partial mov...
virtual void do_init_for_execution()
static const std::string & get_error_name(int error_code)
get human-readable name of the error by code.
const map_location & location_
virtual void do_execute()
game_info & get_info() const