48 return recall->print(s);
53 return recall->print(s);
63 :
action(team_index,hidden)
84 std::size_t underlying_id = cfg[
"temp_unit_"];
142 success = complete = result;
151 <<
"] at position " <<
temp_unit_->get_location() <<
".";
168 if (it->recall_cost() > -1) {
169 cost = it->recall_cost();
199 const double x_offset = 0.5;
200 const double y_offset = 0.7;
202 std::stringstream number_text;
211 std::size_t font_size = 16;
214 number_text.str(), font_size, color, x_offset, y_offset);
255 final_cfg[
"type"] =
"recall";
256 final_cfg[
"temp_unit_"] =
static_cast<int>(
temp_unit_->underlying_id());
262 final_cfg.
add_child(
"recall_hex_", std::move(loc_cfg));
void reset()
Reset the internal unit pointer, and deregister from the manager.
std::shared_ptr< wb::side_actions > get_side_actions() const
get the whiteboard planned actions for this team
Move numbering for the whiteboard.
static display * get_singleton()
Returns the display object if a display object exists.
virtual const std::vector< team > & teams() const override
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.
This class represents a single unit of a specific type.
umap_retval_pair_t insert(unit_ptr p)
Inserts the unit pointed to by p into the map.
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.
std::shared_ptr< recall const > recall_const_ptr
virtual void execute(bool &success, bool &complete)
Output parameters: success: Whether or not to continue an execute-all after this execution complete: ...
virtual void accept(visitor &v)
bool recall_unit(const std::string &id, team ¤t_team, const map_location &loc, const map_location &from, map_location::DIRECTION facing, bool show, bool use_undo)
Recalls the unit with the indicated ID for the provided team.
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.
std::shared_ptr< unit > unit_ptr
std::size_t team_index() const
Returns the index of the team that owns this action.
virtual void draw_hex(const map_location &hex)
Gets called by display when drawing a hex, to allow actions to draw to the screen.
bool valid()
Returns whether this action is valid or not.
This class stores all the data for a single 'side' (in game nomenclature).
static std::string at(const std::string &file, int line)
const std::string unicode_minus
const config & recall_filter() const
Gets the filter constraints upon which units this unit may recall, if able.
int un_recall_unit_cost(const unit &u)
The basic class for representing 8-bit RGB or RGBA colour values.
fake_unit_manager * fake_units
void draw_text_in_hex(const map_location &loc, const drawing_layer layer, const std::string &text, std::size_t font_size, color_t color, double x_in_hex=0.5, double y_in_hex=0.5)
Draw text on a hex.
map_display and display: classes which take care of displaying the map and game-data on the screen...
std::shared_ptr< recall > shared_from_this()
Encapsulates the map of the game.
Various functions related to the creation of units (recruits, recalls, and placed units)...
virtual error check_validity() const
Check the validity of the action.
virtual std::ostream & print(std::ostream &s) const
virtual void redraw()
Redrawing function, called each time the action situation might have changed.
static map_location::DIRECTION s
map_location const get_recall_hex() const
static void ignore_error_function(const std::string &message)
A function to be passed to run_in_synced_context to ignore the error.
config & add_child(config_key_type key)
bool any_recruiter(int team_num, const map_location &loc, std::function< bool(unit &)> func)
executes func for each unti of side of side_num that can recruit on loc.
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)
A variable-expanding proxy for the config class.
unit_ptr extract(const map_location &loc)
Extracts a unit from the map.
virtual config to_config() const
static const map_location & null_location()
Container associating units to locations.
std::ostream & operator<<(std::ostream &s, action_ptr action)
std::shared_ptr< recall > recall_ptr
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.
recall(std::size_t team_index, bool hidden, const unit &unit, const map_location &recall_hex)
virtual config to_config() const
Constructs and returns a config object representing this object.
virtual unit_ptr get_unit() const
Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses...