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
ai::gamestate_observer Class Reference

#include <gamestate_observer.hpp>

Inheritance diagram for ai::gamestate_observer:
Inheritance graph

Public Member Functions

 gamestate_observer ()
 
virtual ~gamestate_observer ()
 
void handle_generic_event (const std::string &event_name)
 
bool is_gamestate_changed ()
 Check if the gamestate has changed since last reset reset is done once on construction, and can be done by hand via reset() method. More...
 
void reset ()
 Reset the counter of gamestate changes. More...
 
- Public Member Functions inherited from events::observer
virtual ~observer ()
 

Private Attributes

int gamestate_change_counter_
 

Detailed Description

Definition at line 27 of file gamestate_observer.hpp.

Constructor & Destructor Documentation

ai::gamestate_observer::gamestate_observer ( )

Definition at line 27 of file gamestate_observer.cpp.

References ai::manager::add_gamestate_observer().

ai::gamestate_observer::~gamestate_observer ( )
virtual

Definition at line 34 of file gamestate_observer.cpp.

References ai::manager::remove_gamestate_observer().

Member Function Documentation

void ai::gamestate_observer::handle_generic_event ( const std::string event_name)
virtual

Implements events::observer.

Definition at line 40 of file gamestate_observer.cpp.

References gamestate_change_counter_.

bool ai::gamestate_observer::is_gamestate_changed ( )

Check if the gamestate has changed since last reset reset is done once on construction, and can be done by hand via reset() method.

Returns
has gamestate changed since last reset?

Definition at line 46 of file gamestate_observer.cpp.

References gamestate_change_counter_.

Referenced by ai::ai_default_rca::candidate_action_evaluation_loop::do_play_stage(), and ai::lua_stage_wrapper::do_play_stage().

void ai::gamestate_observer::reset ( )

Reset the counter of gamestate changes.

Definition at line 52 of file gamestate_observer.cpp.

References gamestate_change_counter_.

Member Data Documentation

int ai::gamestate_observer::gamestate_change_counter_
private

Definition at line 54 of file gamestate_observer.hpp.

Referenced by handle_generic_event(), is_gamestate_changed(), and reset().


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