The Battle for Wesnoth  1.19.0-dev
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 184 of file game_board.hpp.

Constructor & Destructor Documentation

◆ temporary_unit_placer() [1/2]

temporary_unit_placer::temporary_unit_placer ( unit_map m,
const map_location loc,
unit u 
)

Definition at line 413 of file game_board.cpp.

References unit_map::add(), m_, and unit::mark_clone().

◆ temporary_unit_placer() [2/2]

temporary_unit_placer::temporary_unit_placer ( game_board m,
const map_location loc,
unit u 
)

Definition at line 422 of file game_board.cpp.

References unit_map::add(), m_, and unit::mark_clone().

◆ ~temporary_unit_placer()

temporary_unit_placer::~temporary_unit_placer ( )
virtual

Member Data Documentation

◆ loc_

const map_location temporary_unit_placer::loc_
private

Definition at line 192 of file game_board.hpp.

Referenced by ~temporary_unit_placer().

◆ m_

unit_map& temporary_unit_placer::m_
private

Definition at line 191 of file game_board.hpp.

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

◆ temp_

unit_ptr temporary_unit_placer::temp_
private

Definition at line 193 of file game_board.hpp.

Referenced by ~temporary_unit_placer().


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