45 return recall->print(s);
50 return recall->print(s);
61 temp_unit_(new class unit(unit)),
62 recall_hex_(recall_hex),
63 fake_unit_(
unit_ptr( new class unit(unit) ) )
71 , recall_hex_(cfg.child(
"recall_hex_")[
"x"],cfg.child(
"recall_hex_")[
"y"])
75 size_t underlying_id = cfg[
"temp_unit_"];
136 success = complete =
result;
145 <<
"] at position " <<
temp_unit_->get_location() <<
".\n";
153 if (it->recall_cost() > -1) {
154 cost = it->recall_cost();
179 const double x_offset = 0.5;
180 const double y_offset = 0.7;
182 std::stringstream number_text;
192 SDL_Color
color; color.r = 255; color.g = 0; color.b = 0;
230 final_cfg[
"type"] =
"recall";
231 final_cfg[
"temp_unit_"] =
static_cast<int>(
temp_unit_->underlying_id());
237 final_cfg.
add_child(
"recall_hex_",loc_cfg);
void reset()
Reset the internal unit pointer, and deregister from the manager. This fake_unit_ptr is now dissassoc...
virtual unit_ptr get_unit() const
boost::shared_ptr< wb::side_actions > get_side_actions() const
get the whiteboard planned actions for this team
void invalidate_game_status()
Function to invalidate the game status displayed on the sidebar.
bool invalidate(const map_location &loc)
Function to invalidate a specific tile for redrawing.
virtual error check_validity() const
Check the validity of the action.
static config get_recall(const std::string &unit_id, const map_location &loc, const map_location &from)
virtual void do_hide()
Called by the non-virtual hide() and show(), respectively.
void place_on_fake_unit_manager(fake_unit_manager *d)
Place this on manager's fake_units_ dequeue.
virtual void execute(bool &success, bool &complete)
Output parameters: success: Whether or not to continue an execute-all after this execution complete: ...
boost::shared_ptr< recall > shared_from_this()
virtual config to_config() const
recall(size_t team_index, bool hidden, const unit &unit, const map_location &recall_hex)
unit * find_recruiter(size_t team_index, map_location const &hex)
virtual void accept(visitor &v)
map_location const get_recall_hex() const
virtual void remove_temp_modifier(unit_map &unit_map)
Removes the result of this action from the specified unit map.
virtual void visit(move_ptr move)=0
virtual void apply_temp_modifier(unit_map &unit_map)
Applies temporarily the result of this action to the specified unit map.
void draw_text_in_hex(const map_location &loc, const tdrawing_layer layer, const std::string &text, size_t font_size, SDL_Color color, double x_in_hex=0.5, double y_in_hex=0.5)
Draw text on a hex.
virtual void draw_hex(const map_location &hex)
Gets called by display when drawing a hex, to allow actions to draw to the screen.
const std::string unicode_minus
bool valid()
Returns whether this action is valid or not.
This class stores all the data for a single 'side' (in game nomenclature).
size_t team_index() const
Returns the index of the team that owns this action.
static std::string at(const std::string &file, int line)
std::vector< team > * teams
std::pair< unit_iterator, bool > insert(unit_ptr p)
Adds the unit to the map.
static void ignore_error_function(const std::string &message, bool heavy)
a function to be passed to run_in_synced_context to ignore the error.
int un_recall_unit_cost(const unit &u)
config & add_child(const std::string &key)
fake_unit_manager * fake_units
static const map_location & null_location()
Encapsulates the map of the game.
Various functions related to the creation of units (recruits, recalls, and placed units)...
Move numbering for the whiteboard.
virtual void redraw()
Redrawing function, called each time the action situation might have changed.
virtual std::ostream & print(std::ostream &s) const
static bool run_and_throw(const std::string &commandname, const config &data, bool use_undo=true, bool show=true, synced_command::error_handler_function error_handler=default_error_function)
boost::intrusive_ptr< unit > unit_ptr
bool find(E event, F functor)
Tests whether an event handler is available.
virtual config to_config() const
Constructs and returns a config object representing this object.
unit_ptr extract(const map_location &loc)
Extracts a unit from the map.
bool recall_unit(const std::string &id, team ¤t_team, const map_location &loc, const map_location &from, bool show, bool use_undo)
Recalls the unit with the indicated ID for the provided team.
Container associating units to locations.
std::ostream & operator<<(std::ostream &s, action_ptr action)
visitor is an abstract interface : action.accept(visitor) calls visitor.visit(action) ...
Abstract base class for all the whiteboard planned actions.
A config object defines a single node in a WML file, with access to child nodes.
Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses...