88 explicit operator bool()
const
89 {
return unit_.get() !=
nullptr; }
Manages a list of fake units for the display object.
Holds a temporary unit that can be drawn on the map without being placed in the unit_map.
unit & operator*()
Derference the internal unit pointer.
internal_ptr get_unit_ptr()
Get a copy of the internal unit pointer.
void reset()
Reset the internal unit pointer, and deregister from the manager.
fake_unit_manager * my_manager_
Raw pointer to the manager.
internal_const_ptr operator->() const
Dereference the internal unit pointer.
~fake_unit_ptr()
Removes this from the fake_units_ list if necessary.
unit_const_ptr internal_const_ptr
fake_unit_ptr & operator=(fake_unit_ptr other)
Copy assignment operator using copy-and-swap idiom.
internal_const_ptr get_unit_ptr() const
Get a copy of the internal unit pointer.
unit * get()
Get a raw pointer to the underlying unit.
void swap(fake_unit_ptr &o)
Pointer swap.
internal_ptr operator->()
Dereference the internal unit pointer.
int remove_from_fake_unit_manager()
Removes this from whatever fake_units_ list it is on (if any).
internal_ptr unit_
Internal unit pointer.
void place_on_fake_unit_manager(fake_unit_manager *d)
Place this on manager's fake_units_ dequeue.
This class represents a single unit of a specific type.
std::shared_ptr< const unit > unit_const_ptr
std::shared_ptr< unit > unit_ptr