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

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

#include <unit.hpp>

Inheritance diagram for unit_movement_resetter:
Inheritance graph

Public Member Functions

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

Private Attributes

unitu_
 
int moves_
 

Detailed Description

Object which temporarily resets a unit's movement.

Warning
The unit whose movement is reset may not be deleted while a unit_movement_resetter object 'holds'. So best use it only in a small scope.

Definition at line 561 of file unit.hpp.

Constructor & Destructor Documentation

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

Definition at line 2392 of file unit.cpp.

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

unit_movement_resetter::~unit_movement_resetter ( )

Definition at line 2400 of file unit.cpp.

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

Member Data Documentation

int unit_movement_resetter::moves_
private

Definition at line 569 of file unit.hpp.

Referenced by ~unit_movement_resetter().

unit& unit_movement_resetter::u_
private

Definition at line 568 of file unit.hpp.

Referenced by ~unit_movement_resetter().


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