-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event.cpp
73 lines (71 loc) · 1.32 KB
/
Event.cpp
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
#include "Event.h"
#ifndef EVENT_CPP
#define EVENT_CPP
Event::Event(UID _sender, event_t _type)
{
sender = sender;
receiver = (UID)0;
type = _type;
args[0] = Variant();
args[1] = Variant();
args[2] = Variant();
args[3] = Variant();
}
Event::Event()
{
sender = (UID)0;
receiver = (UID)0;
type = NOT_EVENT;
args[0] = Variant();
args[1] = Variant();
args[2] = Variant();
args[3] = Variant();
}
Event::Event(const Event& event)
{
sender = event.sender;
receiver = event.receiver;
type = event.type;
args[0] = event.args[0];
args[1] = event.args[1];
args[2] = event.args[2];
args[3] = event.args[3];
}
Event::~Event()
{
sender = 0;
type = NOT_EVENT;
args[0] = Variant();
args[1] = Variant();
args[2] = Variant();
args[3] = Variant();
}
bool Event::setArg(Variant arg)
{
args[0] = arg;
}
bool Event::setArgs(Variant arg0, Variant arg1, Variant arg2, Variant arg3)
{
args[0] = arg0;
args[1] = arg1;
args[2] = arg2;
args[3] = arg3;
}
bool Event::setArgs(int val0, int val1, int val2, int val3)
{
args[0] = Variant(val0,val1,val2,val3);
}
bool Event::setArgs(float val0, float val1, float val2, float val3)
{
args[0] = Variant(val0,val1,val2,val3);
}
bool Event::setArgs(int arg, char* val, int len)
{
for(int i = 0; i < len; i++)
{
args[arg].datum.v_asChar[i] = val[i];
}
}
/*.S.D.G.*/
#endif
//int main(){return 0;}