36 return action->print(s);
42 return action->print(s);
53 final_cfg[
"type"]=
"action";
54 final_cfg[
"team_index_"]=
static_cast<int>(
team_index_);
66 else if(type==
"attack")
68 else if(type==
"recruit")
70 else if(type==
"recall")
72 else if(type==
"suppose_dead")
96 : team_index_(team_index)
106 int team_index_temp = cfg[
"team_index_"].to_int(-1);
107 if(team_index_temp < 0
109 throw ctor_err(
"action: Invalid team_index_");
120 return ret ? ret->underlying_id() : 0;
boost::shared_ptr< action > action_ptr
GLuint GLuint GLsizei GLenum type
Definitions for the interface to Wesnoth Markup Language (WML).
std::vector< team > * teams
virtual std::ostream & print(std::ostream &s) const =0
size_t get_unit_id() const
Returns the id of the unit targeted by this action.
virtual unit_ptr get_unit() const =0
Return the unit targeted by this action.
static action_ptr from_config(config const &, bool hidden)
Constructs an object of a subclass of wb::action using a config.
void hide()
Sets whether or not the action should be drawn on the screen.
virtual config to_config() const
Constructs and returns a config object representing this object.
std::ostream & operator<<(std::ostream &s, action_ptr action)
action(size_t team_index, bool hidden)
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.
GLsizei const GLcharARB ** string
A planned move, represented on the map by an arrow and a ghosted unit in the destination hex...
A planned action that temporarily removes a unit from the map for planning purposes.
virtual void do_hide()
Called by the non-virtual hide() and show(), respectively.