Dragonfly  4.3
A text-based game engine
EventView.h
1 ///
2 /// A "view" event
3 ///
4 
5 #ifndef __EVENT_VIEW_H__
6 #define __EVENT_VIEW_H__
7 
8 #include "Event.h"
9 
10 namespace df {
11 
12 const std::string VIEW_EVENT = "df::view";
13 
14 class EventView : public Event {
15 
16  private:
17  std::string m_tag; ///< Tag to associate.
18  int m_value; ///< Value for view.
19  bool m_delta; ///< True if change in value, else replace value
20 
21  public:
22  /// Create view event with tag VIEW_EVENT, value 0 and delta false.
23  EventView();
24 
25  /// Create view event with tag, value and delta as indicated.
26  EventView(std::string new_tag, int new_value, bool new_delta);
27 
28  /// Set tag to new tag.
29  void setTag(std::string new_tag);
30 
31  /// Get tag.
32  std::string getTag() const;
33 
34  /// Set value to new value.
35  void setValue(int new_value);
36 
37  /// Get value.
38  int getValue() const;
39 
40  /// Set delta to new delta.
41  void setDelta(bool new_delta);
42 
43  /// Get delta.
44  bool getDelta() const;
45 };
46 
47 } // end of namespace df
48 #endif // __EVENT_VIEW_H__
bool m_delta
True if change in value, else replace value.
Definition: EventView.h:19
void setDelta(bool new_delta)
Set delta to new delta.
Definition: EventView.h:14
Definition: Event.h:15
A 2-d bounding box.
Definition: Box.h:10
std::string m_tag
Tag to associate.
Definition: EventView.h:17
int getValue() const
Get value.
std::string getTag() const
Get tag.
int m_value
Value for view.
Definition: EventView.h:18
bool getDelta() const
Get delta.
void setValue(int new_value)
Set value to new value.
EventView()
Create view event with tag VIEW_EVENT, value 0 and delta false.
void setTag(std::string new_tag)
Set tag to new tag.