This object is used to temporary remove a unit from the unit map. More...
#include <game_board.hpp>
Public Member Functions | |
temporary_unit_remover (unit_map &m, const map_location &loc) | |
temporary_unit_remover (game_board &m, const map_location &loc) | |
virtual | ~temporary_unit_remover () |
Private Attributes | |
unit_map & | m_ |
const map_location | loc_ |
unit_ptr | temp_ |
This object is used to temporary remove a unit from the unit map.
On destruction, it restores the unit map to its original. unit_map iterators to this unit must not be accessed while the unit is temporarily removed, otherwise a collision will happen when trying to reinsert the unit.
Definition at line 183 of file game_board.hpp.
temporary_unit_remover::temporary_unit_remover | ( | unit_map & | m, |
const map_location & | loc | ||
) |
Definition at line 398 of file game_board.cpp.
temporary_unit_remover::temporary_unit_remover | ( | game_board & | m, |
const map_location & | loc | ||
) |
Definition at line 403 of file game_board.cpp.
|
virtual |
Definition at line 408 of file game_board.cpp.
References unit_map::insert(), m_, and temp_.
|
private |
Definition at line 191 of file game_board.hpp.
|
private |
Definition at line 190 of file game_board.hpp.
Referenced by ~temporary_unit_remover().
|
private |
Definition at line 192 of file game_board.hpp.
Referenced by ~temporary_unit_remover().