#include <gamestate_observer.hpp>
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_ |
Definition at line 27 of file gamestate_observer.hpp.
ai::gamestate_observer::gamestate_observer | ( | ) |
Definition at line 28 of file gamestate_observer.cpp.
References ai::manager::add_gamestate_observer(), and ai::manager::get_singleton().
|
virtual |
Definition at line 35 of file gamestate_observer.cpp.
References ai::manager::get_singleton(), and ai::manager::remove_gamestate_observer().
|
virtual |
Implements events::observer.
Definition at line 41 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.
Definition at line 47 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 53 of file gamestate_observer.cpp.
References gamestate_change_counter_.
|
private |
Definition at line 54 of file gamestate_observer.hpp.
Referenced by handle_generic_event(), is_gamestate_changed(), and reset().