33 class action :
public std::enable_shared_from_this<action>
40 virtual std::ostream&
print(std::ostream&
s)
const = 0;
49 virtual void execute(
bool& success,
bool& complete) = 0;
A config object defines a single node in a WML file, with access to child nodes.
Holds a temporary unit that can be drawn on the map without being placed in the unit_map.
Container associating units to locations.
Abstract base class for all the whiteboard planned actions.
virtual unit_ptr get_unit() const =0
Return the unit targeted by this action.
virtual void remove_temp_modifier(unit_map &unit_map)=0
Removes the result of this action from the specified unit map.
void hide()
Sets whether or not the action should be drawn on the screen.
bool valid()
Returns whether this action is valid or not.
virtual void do_hide()
Called by the non-virtual hide() and show(), respectively.
static action_ptr from_config(const config &, bool hidden)
Constructs an object of a subclass of wb::action using a config.
std::size_t team_index() const
Returns the index of the team that owns this action.
virtual void redraw()
Redrawing function, called each time the action situation might have changed.
bool is_numbering_hex(const map_location &hex) const
Indicates whether this hex is the preferred hex to draw the numbering for this action.
virtual void execute(bool &success, bool &complete)=0
Output parameters: success: Whether or not to continue an execute-all after this execution complete: ...
virtual bool places_new_unit() const
Returns true for recall and recruit actions.
action(std::size_t team_index, bool hidden)
virtual std::size_t get_unit_id() const
Returns the id of the unit targeted by this action.
virtual void apply_temp_modifier(unit_map &unit_map)=0
Applies temporarily the result of this action to the specified unit map.
virtual fake_unit_ptr get_fake_unit()=0
virtual std::ostream & print(std::ostream &s) const =0
virtual config to_config() const
Constructs and returns a config object representing this object.
int side_number() const
Returns the number of the side that owns this action, i.e.
virtual map_location get_numbering_hex() const =0
virtual void draw_hex(const map_location &hex)=0
Gets called by display when drawing a hex, to allow actions to draw to the screen.
virtual void accept(visitor &v)=0
virtual error check_validity() const =0
Check the validity of the action.
Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses.
std::ostream & operator<<(std::ostream &s, action_ptr action)
std::shared_ptr< action > action_ptr
std::shared_ptr< action const > action_const_ptr
std::shared_ptr< unit > unit_ptr
Base class for all the errors encountered by the engine.
Encapsulates the map of the game.
ctor_err(const std::string &message)
static map_location::direction s
Contains typedefs for the whiteboard.