-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.h
111 lines (97 loc) · 4.03 KB
/
Event.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
100
101
102
103
104
105
106
107
108
109
110
111
#pragma once
#include <string>
#include "Event.pb.h"
namespace GameAnalytics
{
class Event
{
public:
Event();
virtual ~Event();
virtual std::string getCategory() = 0;
operator ProtocolBuffers::GameAnalytics::Event() const;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the underlying message, to be directly manipulated, use with caution!
/// </summary>
///
/// <returns>
/// null if it fails, else the message.
/// </returns>
////////////////////////////////////////////////////////////////////////////////////////////////////
ProtocolBuffers::GameAnalytics::Event* getMessage();
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Constructs the JSON for the message including all fields from the sub classes, in a compact
/// not so human readable form.
/// </summary>
///
/// <param name="uid"> The User Identifier. </param>
/// <param name="sid"> The Session Identifier. </param>
/// <param name="build"> The build. </param>
///
/// <returns>
/// The JSON.
/// </returns>
////////////////////////////////////////////////////////////////////////////////////////////////////
std::string constructJSON(std::string uid, std::string sid, std::string build);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Sets the parameters for the underlying event.
/// </summary>
///
/// <param name="uid"> The UID. </param>
/// <param name="sid"> The SID. </param>
/// <param name="build"> The build. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void setParameters(std::string uid, std::string sid, std::string build);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Sets the identifier for this event.
///
/// Identifies the event. This field can be sub-categorized by using ":" notation. For example,
/// an event_id could be: "PickedUpAmmo:Shotgun" (for design), "Purchase:RocketLauncher"
/// (for business), or "Exception:NullReference" (for quality).
/// </summary>
///
/// <param name="id"> The identifier. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void setIdentifier(std::string id);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Sets the area this event happened in.
///
/// Indicates the area or game level where the event occurred.
/// </summary>
///
/// <param name="area"> The area. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void setArea(std::string area);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// X-position where the event occurred.
/// </summary>
///
/// <param name="x"> The x coordinate. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void setX(float x);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Y-position where the event occurred.
/// </summary>
///
/// <param name="y"> The y coordinate. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void setY(float y);
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Z-position where the event occurred.
/// </summary>
///
/// <param name="z"> The z coordinate. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void setZ(float z);
protected:
ProtocolBuffers::GameAnalytics::Event mData;
};
}