44 return sup_d->print(s);
50 return sup_d->print(s);
55 s <<
"Suppose-dead for unit " <<
get_unit()->name() <<
" [" <<
get_unit()->id() <<
"] "
56 <<
"at (" <<
loc_ <<
")";
61 :
action(team_index,hidden)
62 , unit_underlying_id_(curr_unit.underlying_id())
63 , unit_id_(curr_unit.
id())
71 , unit_underlying_id_(0)
73 ,
loc_(cfg.child(
"loc_")[
"x"],cfg.child(
"loc_")[
"y"])
113 {success =
false; complete =
true;}
119 DBG_WB <<
"Suppose dead: Temporarily removing unit " << removed_unit->name() <<
" [" << removed_unit->id()
120 <<
"] from (" <<
loc_ <<
")\n";
123 assert(
get_unit().
get() == removed_unit.get());
183 final_cfg[
"type"]=
"suppose_dead";
virtual void apply_temp_modifier(unit_map &unit_map)
Applies temporarily the result of this action to the specified unit map.
void drawing_buffer_add(const tdrawing_layer layer, const map_location &loc, int x, int y, const surface &surf, const SDL_Rect &clip=SDL_Rect())
Add an item to the drawing buffer.
surface get_image(const image::locator &i_locator, TYPE type)
function to get the surface corresponding to an image.
Arrows destined to be drawn on the map.
virtual unit_ptr get_unit() const
Return the unit targeted by this action.
bool invalidate(const map_location &loc)
Function to invalidate a specific tile for redrawing.
suppose_dead(size_t team_index, bool hidden, unit &curr_unit, map_location const &loc)
virtual map_location get_source_hex() const
Return the location at which this action was planned.
virtual void remove_temp_modifier(unit_map &unit_map)
Removes the result of this action from the specified unit map.
virtual void redraw()
Redrawing function, called each time the action situation might have changed.
size_t unit_underlying_id_
virtual error check_validity() const
Check the validity of the action.
Arrows from the arrows framework.
virtual void visit(move_ptr move)=0
virtual std::ostream & print(std::ostream &s) const
int get_location_x(const map_location &loc) const
Functions to get the on-screen positions of hexes.
Contains the exception interfaces used to signal completion of a scenario, campaign or turn...
Definitions for the interface to Wesnoth Markup Language (WML).
virtual void accept(visitor &v)
int get_location_y(const map_location &loc) const
tdrawing_layer
The layers to render something on.
bool valid()
Returns whether this action is valid or not.
pointer get_shared_ptr() const
GLenum GLenum GLuint GLint GLint layer
std::pair< unit_iterator, bool > insert(unit_ptr p)
Adds the unit to the map.
config & add_child(const std::string &key)
virtual void execute(bool &success, bool &complete)
Output parameters: success: Whether or not to continue an execute-all after this execution complete: ...
virtual config to_config() const
Constructs and returns a config object representing this object.
Encapsulates the map of the game.
std::map< std::string, tfilter >::iterator itor
boost::shared_ptr< suppose_dead > shared_from_this()
boost::intrusive_ptr< unit > unit_ptr
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.
Container associating units to locations.
std::ostream & operator<<(std::ostream &s, action_ptr action)
unit_iterator find(size_t id)
virtual void draw_hex(const map_location &hex)
Gets called by display when drawing a hex, to allow actions to draw to the screen.
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.
Display units performing various actions: moving, attacking, and dying.
Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses...