-
Notifications
You must be signed in to change notification settings - Fork 0
/
object.h
48 lines (39 loc) · 1.02 KB
/
object.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
#ifndef OBJECT_H
#define OBJECT_H
#include <list>
#include "wrapped_point.h"
using namespace std;
class Object {
public:
Object();
Object(WrappedPoint position, Point velocity, float rotation_speed = 0.0f);
virtual ~Object() {};
virtual void step(int delta);
virtual bool collide(const Object &other, float proximity = 0.0f) const;
virtual bool collide(const Object &other, float proximity, const Point offset) const;
virtual bool is_removable() const;
void commonInit();
bool is_alive() const;
int get_value() const;
//TODO: work out friend methods ::draw
//TODO: work out inheritance with static, OR, work out borg?
friend class AsteroidDrawer;
friend class Behaviour;
//TODO: Fix encapsulation
WrappedPoint position;
Point velocity;
virtual bool kill();
float radius, radius_squared;
int value;
float rotation, rotation_speed, friction;
bool alive, invincible;
};
inline
bool Object::is_alive() const {
return alive;
}
inline
int Object::get_value() const {
return value;
}
#endif