-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynamicobject.h
45 lines (42 loc) · 1.03 KB
/
dynamicobject.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
#ifndef DYNAMICOBJECT_H
#define DYNAMICOBJECT_H
#include "interactiveobject.h"
namespace SSJ {
class DynamicObject : public InteractiveObject
{
protected:
/*for synchronization by server*/
int velocity; // px per second
Degrees angle;
Degrees targetAngle;
public:
DynamicObject();
void MoveForward();
void MoveBackward();
void MoveLeft();
void MoveRight();
void RotateLeft();
void RotateRight();
Point CalcNewPosition( SSJ::Degrees);
void setVelocity(const int velocity);
int getVelocity() const;
void setAngle(const Degrees angle);
Degrees getAngle() const;
/**
* JSON:
* {
* mapPositionX: "",
* mapPositionY: "",
* activity: "",
* hp: "",
* maxHP: "",
* angle: "",
* targetAngle: "",
* velocity: ""
*
* }
*/
void SynchronizationObject(Json::Value);
};
}
#endif // DYNAMICOBJECT_H