Manages a list of fake units for the display object. More...
#include <fake_unit_manager.hpp>
Public Types | |
typedef unit const * | internal_ptr_type |
typedef std::deque < internal_ptr_type > ::const_iterator | iterator |
typedef std::deque < internal_ptr_type > ::const_iterator | const_iterator |
Public Member Functions | |
fake_unit_manager (display &disp) | |
Construct a fake unit manager from a display which owns it. More... | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
Private Member Functions | |
void | place_temporary_unit (internal_ptr_type) |
Register a unit with this manager. More... | |
int | remove_temporary_unit (internal_ptr_type) |
Deregister a unit from this manager. More... | |
Private Attributes | |
std::deque< internal_ptr_type > | fake_units_ |
collection of units destined to be drawn but not put into the unit map More... | |
display & | my_display_ |
Reference to my display. The display owns me in a scoped_ptr, so this should never be a dangling reference. More... | |
Friends | |
class | fake_unit_ptr |
Manages a list of fake units for the display object.
Definition at line 25 of file fake_unit_manager.hpp.
typedef std::deque<internal_ptr_type>::const_iterator fake_unit_manager::const_iterator |
Definition at line 38 of file fake_unit_manager.hpp.
typedef unit const* fake_unit_manager::internal_ptr_type |
Definition at line 34 of file fake_unit_manager.hpp.
typedef std::deque<internal_ptr_type>::const_iterator fake_unit_manager::iterator |
Definition at line 37 of file fake_unit_manager.hpp.
|
inline |
Construct a fake unit manager from a display which owns it.
Definition at line 28 of file fake_unit_manager.hpp.
|
inline |
Definition at line 40 of file fake_unit_manager.hpp.
References fake_units_.
|
inline |
Definition at line 43 of file fake_unit_manager.hpp.
References fake_units_.
|
inline |
Definition at line 41 of file fake_unit_manager.hpp.
References fake_units_.
|
inline |
Definition at line 44 of file fake_unit_manager.hpp.
References fake_units_.
|
private |
Register a unit with this manager.
Temporarily register a unit to be drawn on the map (moving: can overlap others).
private, should only be called by fake_unit_ptr.
The temp unit is added at the end of the temporary unit dequeue, and therefore gets drawn last, over other units and temp units. Adding the same unit twice isn't allowed.
Definition at line 31 of file fake_unit_manager.cpp.
References ERR_NG, fake_units_, gui2::event::find(), display::invalidate(), and my_display_.
Referenced by fake_unit_ptr::place_on_fake_unit_manager().
|
private |
Deregister a unit from this manager.
Removes any instances of this unit from the temporary unit database.
private, should only be called by fake_unit_ptr.
Definition at line 42 of file fake_unit_manager.cpp.
References ERR_NG, fake_units_, display::invalidate(), my_display_, and schema_validation::remove.
Referenced by fake_unit_ptr::remove_from_fake_unit_manager().
|
friend |
Definition at line 31 of file fake_unit_manager.hpp.
|
private |
collection of units destined to be drawn but not put into the unit map
Definition at line 56 of file fake_unit_manager.hpp.
Referenced by begin(), end(), place_temporary_unit(), and remove_temporary_unit().
|
private |
Reference to my display. The display owns me in a scoped_ptr, so this should never be a dangling reference.
Definition at line 57 of file fake_unit_manager.hpp.
Referenced by place_temporary_unit(), and remove_temporary_unit().