This object is used to temporary move a unit in the unit map, swapping out any unit that is already there. More...
#include <game_board.hpp>
Public Member Functions | |
temporary_unit_mover (unit_map &m, const map_location &src, const map_location &dst, int new_moves, bool stand) | |
Constructor This version will change the unit's current movement to new_moves while the unit is moved (and restored to its previous value upon this object's destruction). More... | |
virtual | ~temporary_unit_mover () |
Private Attributes | |
unit_map & | m_ |
const map_location | src_ |
const map_location | dst_ |
int | old_moves_ |
unit_ptr | temp_ |
bool | stand_ |
This object is used to temporary move 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 224 of file game_board.hpp.
temporary_unit_mover::temporary_unit_mover | ( | unit_map & | m, |
const map_location & | src, | ||
const map_location & | dst, | ||
int | new_moves, | ||
bool | stand | ||
) |
Constructor This version will change the unit's current movement to new_moves while the unit is moved (and restored to its previous value upon this object's destruction).
Definition at line 472 of file game_board.cpp.
References dst_, unit_map::find_unit_ptr(), m_, unit_map::move(), old_moves_, src_, and stand_.
|
virtual |
Definition at line 492 of file game_board.cpp.
References DBG_RG, dst_, unit_map::find_unit_ptr(), utils::get_unknown_exception_type(), unit_map::insert(), m_, unit_map::move(), old_moves_, src_, stand_, and temp_.
|
private |
Definition at line 232 of file game_board.hpp.
Referenced by temporary_unit_mover(), and ~temporary_unit_mover().
|
private |
Definition at line 230 of file game_board.hpp.
Referenced by temporary_unit_mover(), and ~temporary_unit_mover().
|
private |
Definition at line 233 of file game_board.hpp.
Referenced by temporary_unit_mover(), and ~temporary_unit_mover().
|
private |
Definition at line 231 of file game_board.hpp.
Referenced by temporary_unit_mover(), and ~temporary_unit_mover().
|
private |
Definition at line 235 of file game_board.hpp.
Referenced by temporary_unit_mover(), and ~temporary_unit_mover().
|
private |
Definition at line 234 of file game_board.hpp.
Referenced by ~temporary_unit_mover().