-
Notifications
You must be signed in to change notification settings - Fork 0
/
Event.cpp
59 lines (49 loc) · 1012 Bytes
/
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
#include "stdafx.h"
#include "Event.h"
#include <ProtoJSON.h>
namespace GameAnalytics
{
Event::Event() {}
Event::~Event() {}
std::string Event::constructJSON(std::string uid, std::string sid, std::string build)
{
mData.set_user_id(uid);
mData.set_session_id(sid);
mData.set_build(build);
return ProtoJSON::asJSON(mData, ProtoJSON::FormatCompact, true);
}
void Event::setIdentifier(std::string id)
{
mData.set_event_id(id);
}
void Event::setArea(std::string area)
{
mData.set_area(area);
}
void Event::setX(float x)
{
mData.set_x(x);
}
void Event::setY(float y)
{
mData.set_y(y);
}
void Event::setZ(float z)
{
mData.set_z(z);
}
void Event::setParameters(std::string uid, std::string sid, std::string build)
{
mData.set_user_id(uid);
mData.set_session_id(sid);
mData.set_build(build);
}
ProtocolBuffers::GameAnalytics::Event* Event::getMessage()
{
return &mData;
}
Event::operator ProtocolBuffers::GameAnalytics::Event() const
{
return mData;
}
}