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 162 of file game_board.hpp.
temporary_unit_placer::temporary_unit_placer | ( | unit_map & | m, |
const map_location & | loc, | ||
unit & | u | ||
) |
Definition at line 374 of file game_board.cpp.
References unit_map::add(), unit::clone(), and m_.
temporary_unit_placer::temporary_unit_placer | ( | game_board & | m, |
const map_location & | loc, | ||
unit & | u | ||
) |
Definition at line 381 of file game_board.cpp.
References unit_map::add(), unit::clone(), and m_.
|
virtual |
Definition at line 388 of file game_board.cpp.
References unit_map::erase(), unit_map::insert(), loc_, m_, and temp_.
|
private |
Definition at line 170 of file game_board.hpp.
Referenced by ~temporary_unit_placer().
|
private |
Definition at line 169 of file game_board.hpp.
Referenced by temporary_unit_placer(), and ~temporary_unit_placer().
|
private |
Definition at line 171 of file game_board.hpp.
Referenced by ~temporary_unit_placer().