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