-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntity.h
More file actions
executable file
·52 lines (46 loc) · 1.65 KB
/
Entity.h
File metadata and controls
executable file
·52 lines (46 loc) · 1.65 KB
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
/*
* Entity.h
*
* Created on: May 4, 2018
* Author: parkerqueen
*/
#ifndef ENTITY_H_
#define ENTITY_H_
#include "Point.h"
#define AST 0
#define CXA 1
#define SCR 2
#define SHP 3
#define SHP_BMB 4
#define SCR_BMB 5
class Entity {
protected:
static long uidGen;
Point position, *geometry, direct;
int vertices, radius;
long id;
float speed;
public:
Entity(int, int); // Main constructor
Entity(Point &, int, int); // Constructs an entity at given pos
Entity(Point &, Point &, int,
int); // Constructs a bomb, needs position & direction
Point &getPosition(); // Returns the position
int getRadius() const; // Returns the radius
long getId() const; // Returns the ID
void setDirection(Point); // Sets the direction
void wrapAround(); // Checks if an entity is out of bounds
virtual int reward() const; // Returns the reward points of an entity,
// overridden by child classes
virtual void move(); // Moves the entity
virtual void dirTimer(); // Time Logger, overridden by child classes
virtual void triggerGun(
Point = Point()); // Triggers the gun, overridden by child classes
virtual void draw() = 0; // Draws the entity, pure virtual, implemented by
// each child class
virtual int type() const = 0; // Returns the type, pure virtual,
// implemented by each child class
Entity &operator=(Entity &); // Assignment operator
virtual ~Entity(); // Destructor
};
#endif /* ENTITY_H_ */