summaryrefslogtreecommitdiffstats
path: root/src/CRSMSession.hpp
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2017-03-21 22:00:59 +0100
committerMarkus Mittendrein <git@maxmitti.tk>2017-04-06 12:00:13 +0200
commit3fe710cb029522b86ef27c322f0cb793b1368051 (patch)
treea927da96f3851f68e2b16d40f2d20b73d67cce1d /src/CRSMSession.hpp
parente56c72bf1a0edda6deb3da548923939a88fd930b (diff)
downloadmanager-3fe710cb029522b86ef27c322f0cb793b1368051.tar.gz
manager-3fe710cb029522b86ef27c322f0cb793b1368051.zip
Move Parser into own class
Diffstat (limited to 'src/CRSMSession.hpp')
-rw-r--r--src/CRSMSession.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/CRSMSession.hpp b/src/CRSMSession.hpp
new file mode 100644
index 0000000..5c9a72e
--- /dev/null
+++ b/src/CRSMSession.hpp
@@ -0,0 +1,51 @@
+#pragma once
+#include "qt-config/ConfigBase.hpp"
+#include "ClientInfo.hpp"
+
+class CRSM;
+
+class ScenarioSettings {
+public:
+ QString name;
+ ClientInfo wishClient;
+ bool league = false;
+ bool randomLeague = false;
+
+ ScenarioSettings(const QString& name, bool league = false) : name(name), league(league) {}
+ ScenarioSettings(const QString& name, const ClientInfo& client, bool league = false) : name(name), wishClient(client), league(league) {}
+ ScenarioSettings() {}
+ inline bool operator ==(const ScenarioSettings& other) const
+ {
+ return name == other.name && league == other.league && randomLeague == other.randomLeague && wishClient == other.wishClient;
+ }
+};
+
+struct CRSMSession : public ConfigBase {
+ enum SessionState {None = -1, Lobby = 0, Loading = 1, Running = 2};
+
+ Boolean League = false;
+ SessionState State = None;
+ Boolean UserWish = false;
+ Boolean AfkAdmin = false;
+ Integer CountDown = -1;
+ ScenarioSettings Scenario;
+
+
+ struct {
+ ClientInfo Admin;
+ Map(String, ClientInfo) Clients;
+ ClientInfo Server;
+ QMap<ClientInfo, QDateTime> LeaveAdmins;
+ } Clonk;
+
+ struct {
+ ClientInfo Admin;
+ Boolean UseIngameChat = false;
+ } IRC;
+
+ void clear();
+
+ CRSMSession();
+
+ CRSMSession(CRSM* crsm);
+};