Dragonfly 4.20
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
10namespace df {
11
12const std::string VIEW_EVENT = "df-view";
13
14class 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.
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__
Definition: EventView.h:14
int getValue() const
Get value.
bool getDelta() const
Get delta.
EventView(std::string new_tag, int new_value, bool new_delta)
Create view event with tag, value and delta as indicated.
void setDelta(bool new_delta)
Set delta to new delta.
std::string m_tag
Tag to associate.
Definition: EventView.h:17
int m_value
Value for view.
Definition: EventView.h:18
EventView()
Create view event with tag VIEW_EVENT, value 0 and delta false.
void setValue(int new_value)
Set value to new value.
std::string getTag() const
Get tag.
void setTag(std::string new_tag)
Set tag to new tag.
bool m_delta
True if change in value, else replace value.
Definition: EventView.h:19
Definition: Event.h:15
An animation for a sprite.
Definition: Animation.h:15