A planned action that temporarily removes a unit from the map for planning purposes. More...
#include <suppose_dead.hpp>


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 unit * | get_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_dead > | shared_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 |
A planned action that temporarily removes a unit from the map for planning purposes.
Definition at line 31 of file suppose_dead.hpp.
| 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().

| 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.

| wb::suppose_dead::~suppose_dead | ( | ) | [virtual] |
Definition at line 96 of file suppose_dead.cpp.
References display::invalidate(), loc_, and resources::screen.

| 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().

| 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().

| 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.

| 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] |
| virtual map_location wb::suppose_dead::get_numbering_hex | ( | ) | const [inline, virtual] |
| 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().


| 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().


| virtual bool wb::suppose_dead::is_valid | ( | ) | const [inline, virtual] |
| 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().

| 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.

| 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().

| 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.

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.
map_location wb::suppose_dead::loc_ [protected] |
Definition at line 81 of file suppose_dead.hpp.
Referenced by apply_temp_modifier(), draw_hex(), get_numbering_hex(), get_source_hex(), init(), print(), remove_temp_modifier(), to_config(), and ~suppose_dead().
std::string wb::suppose_dead::unit_id_ [protected] |
Definition at line 80 of file suppose_dead.hpp.
Referenced by suppose_dead(), and to_config().
size_t wb::suppose_dead::unit_underlying_id_ [protected] |
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().
| Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:40 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |