-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity.h
34 lines (31 loc) · 1.04 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
#ifndef ENTITY_H
#define ENTITY_H
#include "animation.h"
#include "sprite.h"
#include "header.h"
class Entity
{
private:
QVector<Animation *> animations;
unsigned int animPos;
QRectF imagePos;
QRectF hitbox;
bool facingBack;
int relativePosImage = 0;
public:
Entity();
inline QRectF getHitbox() {return hitbox;};
inline void setHitbox(QRectF value) {hitbox = value;};
QPixmap * getSprite() const;
void addAnimation(Animation * value);
inline QRectF getImagePos() const {return imagePos;};
void setImagePos(QRectF value);
inline unsigned int getAnimPos() const {return animPos;};
inline void setAnimPos(unsigned int value) {animPos = value;};
inline void setFacingBack(bool value) {facingBack = value;};
inline virtual void collide() {};
bool getFacingBack() const;
inline int getRelativePosImage() const {return relativePosImage;};
inline void setRelativePosImage(double value) {relativePosImage = value*constants::TILE_WIDTH;};
};
#endif // ENTITY_H