The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Attributes | List of all members
unit_movement_resetter Struct Reference

Object which temporarily resets a unit's movement. More...

#include <unit.hpp>

Public Member Functions

 unit_movement_resetter (const unit_movement_resetter &)=delete
 
unit_movement_resetteroperator= (const unit_movement_resetter &)=delete
 
 unit_movement_resetter (const unit &u, bool operate=true)
 
 ~unit_movement_resetter ()
 

Private Attributes

unitu_
 
int moves_
 

Detailed Description

Object which temporarily resets a unit's movement.

Warning
A unit whose movement is reset may not be deleted while held in a unit_movement_resetter object, so it's best to use thus only in a small scope.

Definition at line 1902 of file unit.hpp.

Constructor & Destructor Documentation

◆ unit_movement_resetter() [1/2]

unit_movement_resetter::unit_movement_resetter ( const unit_movement_resetter )
delete

◆ unit_movement_resetter() [2/2]

unit_movement_resetter::unit_movement_resetter ( const unit u,
bool  operate = true 
)

Definition at line 2566 of file unit.cpp.

References unit::set_movement(), unit::total_movement(), and u_.

◆ ~unit_movement_resetter()

unit_movement_resetter::~unit_movement_resetter ( )

Definition at line 2575 of file unit.cpp.

References DBG_UT, resources::gameboard, moves_, unit::set_movement(), and u_.

Member Function Documentation

◆ operator=()

unit_movement_resetter& unit_movement_resetter::operator= ( const unit_movement_resetter )
delete

Member Data Documentation

◆ moves_

int unit_movement_resetter::moves_
private

Definition at line 1912 of file unit.hpp.

Referenced by ~unit_movement_resetter().

◆ u_

unit& unit_movement_resetter::u_
private

Definition at line 1911 of file unit.hpp.

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


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