-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.h
93 lines (77 loc) · 1.86 KB
/
Parser.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
#pragma once
#include <string>
#include <vector>
#include <boost/variant.hpp>
#include <boost/optional.hpp>
struct TwitchMessage
{
typedef std::pair<std::string, std::string> Property;
std::vector<Property> properties;
std::string channel;
std::string message;
};
struct TwitchPing
{
std::string server;
};
bool ParseMessage(const std::string &str, boost::variant<TwitchMessage, TwitchPing> &out);
typedef boost::optional<unsigned> GambleAmount;
struct TwitchGamble
{
GambleAmount amount;
};
struct TwitchSafeGamble : public TwitchGamble
{
};
struct TwitchReverseGamble : public TwitchGamble
{
};
bool ParseGamble(const std::string &str, boost::variant<TwitchSafeGamble, TwitchReverseGamble, TwitchGamble> &out);
struct GambleResult
{
unsigned roll;
std::string username;
unsigned munies_changed;
unsigned munies_total;
};
struct GambleWinResult : public GambleResult
{
};
struct GambleLooseResult : public GambleResult
{
};
struct GambleJackpotResult : public GambleResult
{
};
bool ParseGambleResult(const std::string &str, boost::variant<GambleWinResult, GambleLooseResult, GambleJackpotResult> &out);
struct GambleTimeout
{
std::string username;
unsigned timer;
};
bool ParseGambleTimeout(const std::string &str, GambleTimeout &out);
struct BotCommandSetLicense
{
std::string username;
unsigned amount;
};
struct BotCommandSetDefaultLicense
{
unsigned amount;
};
struct BotCommandGetLicense
{
std::string username;
};
struct BotCommandGetAllLicenses
{
int dummy;
};
bool ParseBotCommand(const std::string &str, boost::variant<BotCommandSetLicense, BotCommandSetDefaultLicense, BotCommandGetLicense, BotCommandGetAllLicenses> &out);
struct GiveCommand
{
std::string from;
unsigned amount;
std::string to;
};
bool ParseGiveCommand(const std::string &str, GiveCommand &out);