The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Private Attributes | List of all members
unit::upkeep_value_visitor Class Reference

Visitor helper class to fetch the appropriate upkeep value. More...

#include <unit.hpp>

Inheritance diagram for unit::upkeep_value_visitor:
Inheritance graph

Public Member Functions

 upkeep_value_visitor (const unit &unit)
 
int operator() (const upkeep_full &) const
 Full upkeep equals the unit's level. More...
 
int operator() (const upkeep_loyal &) const
 Loyal units cost no upkeep. More...
 
int operator() (int v) const
 

Private Attributes

const unitu_
 

Detailed Description

Visitor helper class to fetch the appropriate upkeep value.

Definition at line 1091 of file unit.hpp.

Constructor & Destructor Documentation

◆ upkeep_value_visitor()

unit::upkeep_value_visitor::upkeep_value_visitor ( const unit unit)
inlineexplicit

Definition at line 1094 of file unit.hpp.

Member Function Documentation

◆ operator()() [1/3]

int unit::upkeep_value_visitor::operator() ( const upkeep_full ) const
inline

Full upkeep equals the unit's level.

Definition at line 1097 of file unit.hpp.

◆ operator()() [2/3]

int unit::upkeep_value_visitor::operator() ( const upkeep_loyal ) const
inline

Loyal units cost no upkeep.

Definition at line 1103 of file unit.hpp.

◆ operator()() [3/3]

int unit::upkeep_value_visitor::operator() ( int  v) const
inline

Definition at line 1108 of file unit.hpp.

Member Data Documentation

◆ u_

const unit& unit::upkeep_value_visitor::u_
private

Definition at line 1114 of file unit.hpp.


The documentation for this class was generated from the following file: