The Battle for Wesnoth  1.15.3+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

int moves_

Detailed Description

Object which temporarily resets a unit's movement.

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 1945 of file unit.hpp.

Constructor & Destructor Documentation

◆ unit_movement_resetter() [1/2]

unit_movement_resetter::unit_movement_resetter ( const unit_movement_resetter )

◆ unit_movement_resetter() [2/2]

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

Definition at line 2588 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 2597 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 )

Member Data Documentation

◆ moves_

int unit_movement_resetter::moves_

Definition at line 1955 of file unit.hpp.

Referenced by ~unit_movement_resetter().

◆ u_

unit& unit_movement_resetter::u_

Definition at line 1954 of file unit.hpp.

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

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