No Description

event.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef EVENT_H
  2. #define EVENT_H
  3. #include <QString>
  4. #include <QPixmap>
  5. #include <QMap>
  6. class EventType
  7. {
  8. public:
  9. static QString Object;
  10. static QString Warp;
  11. static QString CoordScript;
  12. static QString CoordWeather;
  13. static QString Sign;
  14. static QString HiddenItem;
  15. static QString SecretBase;
  16. };
  17. class Event
  18. {
  19. public:
  20. Event();
  21. public:
  22. int x() {
  23. return getInt("x");
  24. }
  25. int y() {
  26. return getInt("y");
  27. }
  28. int elevation() {
  29. return getInt("elevation");
  30. }
  31. void setX(int x) {
  32. put("x", x);
  33. }
  34. void setY(int y) {
  35. put("y", y);
  36. }
  37. QString get(QString key) {
  38. return values.value(key);
  39. }
  40. int getInt(QString key) {
  41. return values.value(key).toInt(nullptr, 0);
  42. }
  43. void put(QString key, int value) {
  44. put(key, QString("%1").arg(value));
  45. }
  46. void put(QString key, QString value) {
  47. values.insert(key, value);
  48. }
  49. QMap<QString, QString> values;
  50. QPixmap pixmap;
  51. };
  52. #endif // EVENT_H