Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends

wb::suppose_dead Class Reference

A planned action that temporarily removes a unit from the map for planning purposes. More...

#include <suppose_dead.hpp>

Inheritance diagram for wb::suppose_dead:
Inheritance graph
[legend]
Collaboration diagram for wb::suppose_dead:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 suppose_dead (size_t team_index, bool hidden, unit &curr_unit, map_location const &loc)
 suppose_dead (config const &, bool hidden)
virtual ~suppose_dead ()
virtual unitget_unit () const
 Return the unit targeted by this action.
virtual fake_unit_ptr get_fake_unit ()
virtual map_location get_source_hex () const
 Return the location at which this action was planned.
virtual std::ostream & print (std::ostream &s) const
virtual void accept (visitor &v)
virtual void execute (bool &success, bool &complete)
 Output parameters: success: Whether or not to continue an execute-all after this execution complete: Whether or not to delete this action after execution.
virtual void apply_temp_modifier (unit_map &unit_map)
 Applies temporarily the result of this action to the specified unit map.
virtual void remove_temp_modifier (unit_map &unit_map)
 Removes the result of this action from the specified unit map.
virtual void draw_hex (const map_location &hex)
 Gets called by display when drawing a hex, to allow actions to draw to the screen.
virtual map_location get_numbering_hex () const
virtual void set_valid (bool valid)
 Indicates to an action whether its status is invalid, and whether it should change its display (and avoid any change to the game state) accordingly.
virtual bool is_valid () const
virtual config to_config () const
 Constructs and returns a config object representing this object.

Protected Member Functions

boost::shared_ptr< suppose_deadshared_from_this ()

Protected Attributes

size_t unit_underlying_id_
std::string unit_id_
map_location loc_
bool valid_

Private Member Functions

void init ()

Friends

class validate_visitor
class highlight_visitor

Detailed Description

A planned action that temporarily removes a unit from the map for planning purposes.

Definition at line 31 of file suppose_dead.hpp.


Constructor & Destructor Documentation

wb::suppose_dead::suppose_dead ( size_t  team_index,
bool  hidden,
unit curr_unit,
map_location const &  loc 
)

Definition at line 63 of file suppose_dead.cpp.

References init().

Here is the call graph for this function:

wb::suppose_dead::suppose_dead ( config const &  cfg,
bool  hidden 
)

Definition at line 73 of file suppose_dead.cpp.

References unit_map::find(), init(), unit_id_, unit_underlying_id_, and resources::units.

Here is the call graph for this function:

wb::suppose_dead::~suppose_dead (  )  [virtual]

Definition at line 96 of file suppose_dead.cpp.

References display::invalidate(), loc_, and resources::screen.

Here is the call graph for this function:


Member Function Documentation

void wb::suppose_dead::accept ( visitor v  )  [virtual]

Implements wb::action.

Definition at line 112 of file suppose_dead.cpp.

References shared_from_this(), and wb::visitor::visit().

Here is the call graph for this function:

void wb::suppose_dead::apply_temp_modifier ( unit_map unit_map  )  [virtual]

Applies temporarily the result of this action to the specified unit map.

Implements wb::action.

Definition at line 120 of file suppose_dead.cpp.

References DBG_WB, unit_map::extract(), get_unit(), unit::id(), loc_, and unit::name().

Here is the call graph for this function:

void wb::suppose_dead::draw_hex ( const map_location hex  )  [virtual]

Gets called by display when drawing a hex, to allow actions to draw to the screen.

Implements wb::action.

Definition at line 141 of file suppose_dead.cpp.

References display::drawing_buffer_add(), image::get_image(), display::get_location_x(), display::get_location_y(), loc_, image::SCALED_TO_HEX, and resources::screen.

Here is the call graph for this function:

void wb::suppose_dead::execute ( bool &  success,
bool &  complete 
) [virtual]

Output parameters: success: Whether or not to continue an execute-all after this execution complete: Whether or not to delete this action after execution.

Implements wb::action.

Definition at line 117 of file suppose_dead.cpp.

virtual fake_unit_ptr wb::suppose_dead::get_fake_unit (  )  [inline, virtual]
Returns:
null pointer

Implements wb::action.

Definition at line 45 of file suppose_dead.hpp.

virtual map_location wb::suppose_dead::get_numbering_hex (  )  const [inline, virtual]

Implements wb::action.

Definition at line 65 of file suppose_dead.hpp.

References loc_.

virtual map_location wb::suppose_dead::get_source_hex (  )  const [inline, virtual]

Return the location at which this action was planned.

Definition at line 47 of file suppose_dead.hpp.

References loc_.

unit * wb::suppose_dead::get_unit (  )  const [virtual]

Return the unit targeted by this action.

Null if unit doesn't exist.

Implements wb::action.

Definition at line 103 of file suppose_dead.cpp.

References unit_map::find(), unit_underlying_id_, resources::units, and unit_map::iterator_base< iter_types >::valid().

Referenced by apply_temp_modifier(), print(), and remove_temp_modifier().

Here is the call graph for this function:

Here is the caller graph for this function:

void wb::suppose_dead::init (  )  [private]

Definition at line 91 of file suppose_dead.cpp.

References display::invalidate(), loc_, and resources::screen.

Referenced by suppose_dead().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool wb::suppose_dead::is_valid (  )  const [inline, virtual]

Implements wb::action.

Definition at line 68 of file suppose_dead.hpp.

References valid_.

std::ostream & wb::suppose_dead::print ( std::ostream &  s  )  const [virtual]

Implements wb::action.

Definition at line 56 of file suppose_dead.cpp.

References get_unit(), unit::id(), loc_, and unit::name().

Here is the call graph for this function:

void wb::suppose_dead::remove_temp_modifier ( unit_map unit_map  )  [virtual]

Removes the result of this action from the specified unit map.

Implements wb::action.

Definition at line 131 of file suppose_dead.cpp.

References unit_map::find(), get_unit(), unit_map::insert(), loc_, and resources::units.

Here is the call graph for this function:

void wb::suppose_dead::set_valid ( bool  valid  )  [virtual]

Indicates to an action whether its status is invalid, and whether it should change its display (and avoid any change to the game state) accordingly.

Implements wb::action.

Definition at line 156 of file suppose_dead.cpp.

References valid_.

boost::shared_ptr<suppose_dead> wb::suppose_dead::shared_from_this (  )  [inline, protected]

Definition at line 75 of file suppose_dead.hpp.

Referenced by accept().

Here is the caller graph for this function:

config wb::suppose_dead::to_config (  )  const [virtual]

Constructs and returns a config object representing this object.

Reimplemented from wb::action.

Definition at line 161 of file suppose_dead.cpp.

References config::add_child(), loc_, unit_id_, unit_underlying_id_, map_location::x, and map_location::y.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class highlight_visitor [friend]

Definition at line 35 of file suppose_dead.hpp.

friend class validate_visitor [friend]

Definition at line 34 of file suppose_dead.hpp.


Member Data Documentation

std::string wb::suppose_dead::unit_id_ [protected]

Definition at line 80 of file suppose_dead.hpp.

Referenced by suppose_dead(), and to_config().

Definition at line 79 of file suppose_dead.hpp.

Referenced by get_unit(), suppose_dead(), and to_config().

bool wb::suppose_dead::valid_ [protected]

Definition at line 83 of file suppose_dead.hpp.

Referenced by is_valid(), and set_valid().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:40 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs