forked from mrkite/minutor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity.h
44 lines (33 loc) · 1.02 KB
/
entity.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
/** Copyright 2014 EtlamGit */
#ifndef ENTITY_H_
#define ENTITY_H_
#include <QSharedPointer>
#include "./overlayitem.h"
class Tag;
class Entity: public OverlayItem {
public:
explicit Entity(const Point& positionInfo);
static QSharedPointer<OverlayItem> TryParse(const Tag* tag);
virtual bool intersects(const OverlayItem::Cuboid& cuboid) const;
virtual void draw(double offsetX, double offsetZ, double scale,
QPainter *canvas) const;
virtual Point midpoint() const;
void setExtraColor(const QColor& c) {extraColor = c;}
static const int RADIUS = 5;
protected:
Entity() {}
private:
QColor extraColor;
Point pos;
QString display;
// optional POI location(s)
struct POI {
explicit POI(int x = 0, int z = 0): x(x), z(z) {}
explicit POI(const QVector3D& pos3D): x(pos3D.x()), z(pos3D.z()) {}
double x, z;
QColor color;
};
QList<POI> poiList;
void tryParseMemory(const QMap<QString, QVariant> &memories, const QString memory, QColor color);
};
#endif // ENTITY_H_