-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
99 lines (91 loc) · 1.83 KB
/
config.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef CONFIG_H
#define CONFIG_H
#include "point.h"
#include "degrees.h"
#include "sprite.h"
#include <vector>
#include <SFML/Window.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
#include <functional>
#include <queue>
#include <jsoncpp/json/json.h>
#include <sstream>
#define SLOT(object, method) object, (ActionEvent)(&method)
#define _J(enum) intToString(enum)
#define PI 3.14159265
#define Cornflower 153,217,234 // color
namespace SSJ {
string intToString(int);
enum WeaponType{
Glock,
Uzi,
Ak47,
M16,
Shotgun,
SniperRifle,
Bazooka,
Grenade,
Knife
};
enum RequestName{
_synchronizeMainPlayer,
_createMainPlayer,
_createBullet,
_createWeapon
};
enum JsonOption{
_mapPositionX,
_mapPositionY,
_activity,
_hp,
_maxHP,
_velocity,
_angle,
_targetAngle,
_playerId,
_ask,
_parameters,
_objectName,
_name,
_ownerPositionX,
_ownerPositionY,
_ownerAngle,
_weaponType,
_objectAmount,
_synchronize,
_syncId,
_delete,
_ownerSyncId,
_deaths
};
enum ObjectType{
_Object,
_InteractiveObject,
_StaticObject,
_DynamicObject,
_MainPlayer,
_Player,
_Bullet,
_Weapon
};
class Object;
using namespace std;
typedef void(Object::*ActionEvent)(sf::Event);
struct Event{
Event(){ KeyAction = sf::Keyboard::Unknown; }
sf::Event::EventType EventType;
ActionEvent ActionFunction;
sf::Keyboard::Key KeyAction;
Object * object;
};
struct Request{
RequestName action;
Json::Value parameters;
};
class Config{
public:
static string PlayerId;
static size_t RotationSpeed;
};
}
#endif // CONFIG_H