The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gamestate_observer.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2016 by Yurii Chernyi <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * A helper class to observe the game state
18  */
19 
20 #ifndef AI_GAMESTATE_OBSERVER_HPP_INCLUDED
21 #define AI_GAMESTATE_OBSERVER_HPP_INCLUDED
22 
23 #include "generic_event.hpp"
24 
25 namespace ai {
26 
28 public:
29 
30 
32 
33 
34  virtual ~gamestate_observer();
35 
36 
37  void handle_generic_event(const std::string &event_name);
38 
39 
40  /**
41  * Check if the gamestate has changed since last reset
42  * reset is done once on construction, and can be done
43  * by hand via reset() method.
44  * @return has gamestate changed since last reset?
45  */
46  bool is_gamestate_changed();
47 
48  /**
49  * Reset the counter of gamestate changes.
50  */
51  void reset();
52 
53 private:
55 };
56 
57 } //of namespace ai
58 
59 #endif
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.
void handle_generic_event(const std::string &event_name)
A small explanation about what's going on here: Each action has access to two game_info objects First...
Definition: actions.cpp:57
void reset()
Reset the counter of gamestate changes.
GLsizei const GLcharARB ** string
Definition: glew.h:4503