-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrturret.h
More file actions
37 lines (29 loc) · 800 Bytes
/
Copy pathrturret.h
File metadata and controls
37 lines (29 loc) · 800 Bytes
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
/*
* rturret.h
*
* Created on: 2013-09-03
* Author: Liam
*/
#ifndef RTURRET_H_
#define RTURRET_H_
#include "rocket.h"
#include "entitycreator.h"
typedef class RTurret: public Entity, public Observer {
public:
RTurret():m_timer(0), m_direction({1, 0}) {}
RTurret(const vec2d &pos, const vec2d &dir);
virtual void update(float dt);
virtual bool write(std::ofstream &file);
virtual bool read(std::ifstream &file);
virtual void fixup();
private:
void fillImage();
vec2d m_direction;
float m_timer;
} RTurret;
typedef class _RTurretCreator: public EntityCreator {
virtual ~_RTurretCreator() {}
virtual Entity *create() const {return new RTurret;}
virtual Entity *create(const vec2d &pos, const vec2d &dir, const int &dummy) const;
} RTurret_Creator;
#endif /* RTURRET_H_ */