-
Notifications
You must be signed in to change notification settings - Fork 7
/
event.h
executable file
·75 lines (68 loc) · 1.76 KB
/
event.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef EVENT_H
#define EVENT_H
#include <QString>
#include <QPixmap>
#include <QMap>
#include <QDebug>
class EventType
{
public:
static QString Object;
static QString Warp;
static QString CoordScript;
static QString CoordWeather;
static QString Sign;
static QString HiddenItem;
static QString SecretBase;
};
class Event
{
public:
Event();
public:
int x() {
return getInt("x");
}
int y() {
return getInt("y");
}
int elevation() {
return getInt("elevation");
}
void setX(int x) {
put("x", x);
}
void setY(int y) {
put("y", y);
}
QString get(QString key) {
return values.value(key);
}
int getInt(QString key) {
return values.value(key).toInt(nullptr, 0);
}
void put(QString key, int value) {
put(key, QString("%1").arg(value));
}
void put(QString key, QString value) {
values.insert(key, value);
}
static Event* createNewEvent(QString, QString);
static Event* createNewObjectEvent();
static Event* createNewWarpEvent(QString);
static Event* createNewCoordScriptEvent();
static Event* createNewCoordWeatherEvent();
static Event* createNewSignEvent();
static Event* createNewHiddenItemEvent();
static Event* createNewSecretBaseEvent();
QString buildObjectEventMacro(int);
QString buildWarpEventMacro(QMap<QString, QString>*);
QString buildCoordScriptEventMacro();
QString buildCoordWeatherEventMacro();
QString buildSignEventMacro();
QString buildHiddenItemEventMacro();
QString buildSecretBaseEventMacro();
QMap<QString, QString> values;
QPixmap pixmap;
};
#endif // EVENT_H