The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
temporary_unit_placer Struct Reference

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_mapm_
 
const map_location loc_
 
unit_ptr temp_
 

Detailed Description

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.

Constructor & Destructor Documentation

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_.

temporary_unit_placer::~temporary_unit_placer ( )
virtual

Definition at line 388 of file game_board.cpp.

References unit_map::erase(), unit_map::insert(), loc_, m_, and temp_.

Member Data Documentation

const map_location temporary_unit_placer::loc_
private

Definition at line 170 of file game_board.hpp.

Referenced by ~temporary_unit_placer().

unit_map& temporary_unit_placer::m_
private

Definition at line 169 of file game_board.hpp.

Referenced by temporary_unit_placer(), and ~temporary_unit_placer().

unit_ptr temporary_unit_placer::temp_
private

Definition at line 171 of file game_board.hpp.

Referenced by ~temporary_unit_placer().


The documentation for this struct was generated from the following files: