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_remover Struct Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

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.

temporary_unit_remover::~temporary_unit_remover ( )
virtual

Definition at line 408 of file game_board.cpp.

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

Member Data Documentation

const map_location temporary_unit_remover::loc_
private

Definition at line 191 of file game_board.hpp.

unit_map& temporary_unit_remover::m_
private

Definition at line 190 of file game_board.hpp.

Referenced by ~temporary_unit_remover().

unit_ptr temporary_unit_remover::temp_
private

Definition at line 192 of file game_board.hpp.

Referenced by ~temporary_unit_remover().


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