The Battle for Wesnoth  1.19.7+dev
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ai::recursion_counter Class Reference

#include <contexts.hpp>

Public Member Functions

 recursion_counter (int counter)
 
int get_count () const
 Get the current value of the recursion counter. More...
 
bool is_ok () const
 Check if more recursion is allowed. More...
 

Static Public Attributes

static const int MAX_COUNTER_VALUE = 100
 

Private Attributes

int counter_
 

Detailed Description

Definition at line 53 of file contexts.hpp.

Constructor & Destructor Documentation

◆ recursion_counter()

ai::recursion_counter::recursion_counter ( int  counter)
inline

Definition at line 55 of file contexts.hpp.

References MAX_COUNTER_VALUE.

Member Function Documentation

◆ get_count()

int ai::recursion_counter::get_count ( ) const
inline

◆ is_ok()

bool ai::recursion_counter::is_ok ( ) const
inline

Check if more recursion is allowed.

Definition at line 77 of file contexts.hpp.

References counter_, and MAX_COUNTER_VALUE.

Member Data Documentation

◆ counter_

int ai::recursion_counter::counter_
private

Definition at line 84 of file contexts.hpp.

Referenced by get_count(), and is_ok().

◆ MAX_COUNTER_VALUE

const int ai::recursion_counter::MAX_COUNTER_VALUE = 100
static

Definition at line 72 of file contexts.hpp.

Referenced by is_ok(), and recursion_counter().


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