-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSInputComponent.h
More file actions
45 lines (36 loc) · 787 Bytes
/
SInputComponent.h
File metadata and controls
45 lines (36 loc) · 787 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
38
39
40
41
42
43
44
45
#ifndef SINPUTCOMPONENT_H_INCLUDED
#define SINPUTCOMPONENT_H_INCLUDED
#include "entityx.h"
#include <cereal/archives/json.hpp>
#include <fstream>
using namespace lf;
using namespace entityx;
struct InputComponent : Component<InputComponent>
{
bool left;
bool right;
bool up;
bool down;
bool shift;
f32 yaw;
f32 pitch;
f32 roll;
input::EKEY_CODE key;
InputComponent()
{
}
template<class Archive>
void save(Archive & archive) const
{
archive(
CEREAL_NVP(left),
CEREAL_NVP(right),
CEREAL_NVP(up),
CEREAL_NVP(down),
CEREAL_NVP(yaw),
CEREAL_NVP(pitch),
CEREAL_NVP(roll)
);
}
};
#endif // SINPUTCOMPONENT_H_INCLUDED