14 #define ERR_NG LOG_STREAM(err, log_engine)
15 #define LOG_NG LOG_STREAM(info, log_engine)
43 team ¤t_team = (*resources::teams)[side-1];
47 if ( un_it == units.
end() ) {
51 const unit &un = *un_it;
61 units.
erase(recruit_loc);
74 team ¤t_team = (*resources::teams)[side-1];
82 ERR_NG <<
"Trying to redo a recruit for side " << side
83 <<
", which does not recruit type \"" << name <<
"\"\n";
99 if ( loc !=
route.front() ) {
100 ERR_NG <<
"When redoing a recruit at " <<
route.front()
101 <<
", the location was moved to " << loc <<
".\n";
virtual bool undo(int side)
Undoes this action.
bool invalidate(const map_location &loc)
Function to invalidate a specific tile for redrawing.
void do_final_checkup(bool dont_throw=false)
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
void show_transient_message(CVideo &video, const std::string &title, const std::string &message, const std::string &image, const bool message_use_markup, const bool title_use_markup, const bool restore_background)
Shows a transient message to the user.
const std::string & last_recruit() const
const unit_type & type() const
The type of the unit (accounting for gender and variation).
void return_village()
Change village owner on undo.
virtual void write(config &cfg) const
Writes this into the provided config.
This class stores all the data for a single 'side' (in game nomenclature).
void recruit_unit(const unit_type &u_type, int side_num, const map_location &loc, const map_location &from, bool show, bool use_undo)
Recruits a unit of the given type for the given side.
void redo(const config &dst)
const std::set< std::string > get_recruits(int side, const map_location &recruit_loc)
Gets the recruitable units from a side's leaders' personal recruit lists who can recruit on or from a...
void execute_undo_umc_wml()
config & add_child(const std::string &key)
void spend_gold(const int amount)
void write(config &cfg) const
Encapsulates the map of the game.
virtual void write(config &cfg) const
Writes this into the provided config.
Various functions related to the creation of units (recruits, recalls, and placed units)...
t_route route
The hexes occupied by the affected unit during this action.
virtual bool redo(int side)
Redoes this action.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
GLuint const GLchar * name
size_t erase(const map_location &l)
Erases the unit at location l, if any.
const std::string & base_id() const
The id of the original type from which this (variation) descended.
map_location recruit_from
config & child(const std::string &key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
std::string find_recruit_location(const int side, map_location &recruit_location, map_location &recruited_from, const std::string &unit_type)
Finds a location on which to place a unit.
void set_action_bonus_count(const int count)
Standard logging facilities (interface).
CVideo & video()
Gets the underlying screen object.
Container associating units to locations.
void write(config &cfg) const
unit_iterator find(size_t id)
static lg::log_domain log_engine("engine")
void un_recruit_unit(const unit &u)
A config object defines a single node in a WML file, with access to child nodes.
int action_bonus_count() const
config replay_data
the replay data to do this action, this is only !empty() when this action is on the redo stack we nee...
GLsizei const GLcharARB ** string