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 |
bool | empty () 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. More... | |
Friends | |
class | fake_unit_ptr |
Manages a list of fake units for the display object.
Definition at line 24 of file fake_unit_manager.hpp.
typedef std::deque<internal_ptr_type>::const_iterator fake_unit_manager::const_iterator |
Definition at line 37 of file fake_unit_manager.hpp.
typedef unit const* fake_unit_manager::internal_ptr_type |
Definition at line 33 of file fake_unit_manager.hpp.
typedef std::deque<internal_ptr_type>::const_iterator fake_unit_manager::iterator |
Definition at line 36 of file fake_unit_manager.hpp.
|
inline |
Construct a fake unit manager from a display which owns it.
Definition at line 27 of file fake_unit_manager.hpp.
|
inline |
Definition at line 39 of file fake_unit_manager.hpp.
References fake_units_.
|
inline |
Definition at line 42 of file fake_unit_manager.hpp.
References fake_units_.
|
inline |
Definition at line 44 of file fake_unit_manager.hpp.
References fake_units_.
Referenced by game_lua_kernel::intf_find_cost_map().
|
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_.
|
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 32 of file fake_unit_manager.cpp.
References ERR_NG, fake_units_, 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 43 of file fake_unit_manager.cpp.
References utils::erase(), ERR_NG, fake_units_, display::invalidate(), and my_display_.
Referenced by fake_unit_ptr::remove_from_fake_unit_manager().
|
friend |
Definition at line 30 of file fake_unit_manager.hpp.
|
private |
collection of units destined to be drawn but not put into the unit map
Definition at line 55 of file fake_unit_manager.hpp.
Referenced by begin(), empty(), end(), place_temporary_unit(), and remove_temporary_unit().
|
private |
Reference to my display.
Definition at line 57 of file fake_unit_manager.hpp.
Referenced by place_temporary_unit(), and remove_temporary_unit().