-
Notifications
You must be signed in to change notification settings - Fork 0
/
Entity.h
executable file
·73 lines (49 loc) · 1.21 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef ENTITY_H
#define ENTITY_H
#include "Renderer.h"
#include "Level.h"
class Entity
{
public:
Entity( Level& level );
Entity( float x, float y, float z, float velX, float velY, float velZ, float rotX, float rotY, float rotZ, Level& level );
virtual ~Entity();
void tick( float dt );
virtual void render( Renderer& renderer );
int getHealth();
bool getDead();
int getTicks();
virtual void hurt( float damage );
void setPosX( double x );
void setPosY( double y );
void setPosZ( double z );
void setVelX( double velX );
void setVelY( double velY );
void setVelZ( double velZ );
double getPosX();
double getPosY();
double getPosZ();
double getVelX();
double getVelY();
double getVelZ();
void setRotX( double rotX );
void setRotY( double rotY );
void setRotZ( double rotZ );
double getRotX();
double getRotY();
double getRotZ();
double getWidth();
double getHeight();
protected:
int maxHealth;
int health;
float ticks;
bool dead;
double x, y, z, width, height;
double velX, velY, velZ;
double rotX, rotY, rotZ;
virtual void onUpdate( float dt ) = 0;
virtual int getMaxHealth();
Level& level;
};
#endif