porymap/core/heallocation.cpp

31 lines
645 B
C++
Raw Normal View History

2018-09-12 01:37:36 +01:00
#include "heallocation.h"
2018-09-15 00:37:36 +01:00
HealLocation::HealLocation(QString map, int i, uint16_t x, uint16_t y)
{
this->name = map;
this->index = i;
this->x = x;
this->y = y;
2018-09-12 01:37:36 +01:00
}
HealLocation HealLocation::fromEvent(Event *event)
{
HealLocation hl;
hl.name = event->get("loc_name");
try {
hl.index = event->get("index").toInt();
}
catch(...) {
hl.index = 0;
}
hl.x = event->getU16("x");
hl.y = event->getU16("y");
return hl;
}
2018-09-15 00:37:36 +01:00
QDebug operator<<(QDebug debug, const HealLocation &hl)
{
2018-09-12 01:37:36 +01:00
debug << "HealLocation_" + hl.name << "(" << hl.x << ',' << hl.y << ")";
return debug;
}