This object is used to temporary place a unit in the unit map, swapping out any unit that is already there. More...
#include <game_board.hpp>
Public Member Functions | |
temporary_unit_placer (unit_map &m, const map_location &loc, unit &u) | |
temporary_unit_placer (game_board &m, const map_location &loc, unit &u) | |
virtual | ~temporary_unit_placer () |
Private Attributes | |
unit_map & | m_ |
const map_location | loc_ |
unit_ptr | temp_ |
This object is used to temporary place a unit in the unit map, swapping out any unit that is already there.
On destruction, it restores the unit map to its original.
Definition at line 185 of file game_board.hpp.
temporary_unit_placer::temporary_unit_placer | ( | unit_map & | m, |
const map_location & | loc, | ||
unit & | u | ||
) |
Definition at line 411 of file game_board.cpp.
References unit_map::add(), loc, m_, and unit::mark_clone().
temporary_unit_placer::temporary_unit_placer | ( | game_board & | m, |
const map_location & | loc, | ||
unit & | u | ||
) |
Definition at line 420 of file game_board.cpp.
References unit_map::add(), loc, m_, and unit::mark_clone().
|
virtual |
Definition at line 429 of file game_board.cpp.
References DBG_RG, unit_map::erase(), utils::get_unknown_exception_type(), unit_map::insert(), loc_, m_, and temp_.
|
private |
Definition at line 193 of file game_board.hpp.
Referenced by ~temporary_unit_placer().
|
private |
Definition at line 192 of file game_board.hpp.
Referenced by temporary_unit_placer(), and ~temporary_unit_placer().
|
private |
Definition at line 194 of file game_board.hpp.
Referenced by ~temporary_unit_placer().