2018-09-12 01:37:36 +01:00
|
|
|
#include "heallocation.h"
|
2020-03-20 07:09:48 +00:00
|
|
|
#include "config.h"
|
2022-07-19 22:56:12 +01:00
|
|
|
#include "events.h"
|
2020-03-20 17:41:40 +00:00
|
|
|
#include "map.h"
|
2018-09-12 01:37:36 +01:00
|
|
|
|
2022-07-19 22:56:12 +01:00
|
|
|
HealLocation::HealLocation(QString id, QString map,
|
|
|
|
int i, uint16_t x, uint16_t y,
|
|
|
|
QString respawnMap, uint16_t respawnNPC) {
|
2020-03-20 07:09:48 +00:00
|
|
|
this->idName = id;
|
|
|
|
this->mapName = map;
|
|
|
|
this->index = i;
|
|
|
|
this->x = x;
|
|
|
|
this->y = y;
|
|
|
|
this->respawnMap = respawnMap;
|
|
|
|
this->respawnNPC = respawnNPC;
|
2018-09-12 01:37:36 +01:00
|
|
|
}
|
|
|
|
|
2022-07-19 22:56:12 +01:00
|
|
|
HealLocation HealLocation::fromEvent(Event *fromEvent) {
|
|
|
|
HealLocationEvent *event = dynamic_cast<HealLocationEvent *>(fromEvent);
|
|
|
|
|
|
|
|
HealLocation healLocation;
|
|
|
|
healLocation.idName = event->getIdName();
|
|
|
|
healLocation.mapName = event->getLocationName();
|
|
|
|
healLocation.index = event->getIndex();
|
|
|
|
healLocation.x = event->getX();
|
|
|
|
healLocation.y = event->getY();
|
2020-05-22 22:51:56 +01:00
|
|
|
if (projectConfig.getHealLocationRespawnDataEnabled()) {
|
2022-07-19 22:56:12 +01:00
|
|
|
healLocation.respawnNPC = event->getRespawnNPC();
|
|
|
|
healLocation.respawnMap = Map::mapConstantFromName(event->getRespawnMap()).remove(0,4);
|
2020-03-20 07:09:48 +00:00
|
|
|
}
|
2022-07-19 22:56:12 +01:00
|
|
|
return healLocation;
|
2018-09-25 01:21:10 +01:00
|
|
|
}
|
|
|
|
|
2022-07-19 22:56:12 +01:00
|
|
|
QDebug operator<<(QDebug debug, const HealLocation &healLocation) {
|
|
|
|
debug << "HealLocation_" + healLocation.mapName << "(" << healLocation.x << ',' << healLocation.y << ")";
|
2018-09-12 01:37:36 +01:00
|
|
|
return debug;
|
|
|
|
}
|