From 3fe710cb029522b86ef27c322f0cb793b1368051 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Tue, 21 Mar 2017 22:00:59 +0100 Subject: Move Parser into own class --- src/CRSMSession.hpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/CRSMSession.hpp (limited to 'src/CRSMSession.hpp') 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 LeaveAdmins; + } Clonk; + + struct { + ClientInfo Admin; + Boolean UseIngameChat = false; + } IRC; + + void clear(); + + CRSMSession(); + + CRSMSession(CRSM* crsm); +}; -- cgit v1.2.3-54-g00ecf