gamecreateparams.h
1 //------------------------------------------------------------------------------
2 // gamecreateparams.h
3 //------------------------------------------------------------------------------
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301 USA
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2014 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef idF7CFB784_3591_4B2C_B5529AE7FBCC2568
24 #define idF7CFB784_3591_4B2C_B5529AE7FBCC2568
25 
26 #include "dptr.h"
27 #include "global.h"
28 #include <QList>
29 #include <QString>
30 #include <QStringList>
31 
32 class DMFlagsSection;
33 class GameCVar;
34 class GameDemo;
35 class GameMode;
36 class PWad;
37 
42 class MAIN_EXPORT GameCreateParams
43 {
44  public:
45  enum HostMode
46  {
47  Host,
48  Offline,
49  Demo,
50  Remote
51  };
52 
55 
59  const QString& connectPassword() const;
60  void setConnectPassword(const QString& pass);
61 
62  QStringList& customParameters();
63  const QStringList& customParameters() const;
64  void setCustomParameters(const QStringList& customParameters);
65 
70  QList<GameCVar>& cvars();
71  const QList<GameCVar>& cvars() const;
72  void setCvars(const QList<GameCVar>& cvars);
73 
91  const QString& demoPath() const;
92  void setDemoPath(const QString& demoPath);
93 
100  const GameDemo &demoRecord() const;
101  void setDemoRecord(const GameDemo &demo);
102 
103 
104  QList<DMFlagsSection>& dmFlags();
105  const QList<DMFlagsSection>& dmFlags() const;
106 
107  const QString& email() const;
108  void setEmail(const QString& email);
109 
113  const QString& executablePath() const;
114  void setExecutablePath(const QString& executablePath);
115 
116  const GameMode& gameMode() const;
117  void setGameMode(const GameMode& mode);
118 
119  HostMode hostMode() const;
120  void setHostMode(HostMode mode);
121 
122  bool isBroadcastToLan() const;
123  void setBroadcastToLan(bool b);
124 
125  bool isBroadcastToMaster() const;
126  void setBroadcastToMaster(bool b);
127 
128  bool isRandomMapRotation() const;
129  void setRandomMapRotation(bool b);
130 
134  const QString& ingamePassword() const;
135  void setIngamePassword(const QString& pass);
136 
137  const QString& iwadPath() const;
138  void setIwadPath(const QString& iwadPath);
139 
143  QString iwadName() const;
144 
148  const QString& map() const;
149  void setMap(const QString& map);
150 
154  const QStringList& mapList() const;
155  void setMapList(const QStringList& mapList);
156 
157  int maxClients() const;
158  void setMaxClients(int num);
159 
160  int maxPlayers() const;
161  void setMaxPlayers(int num);
162 
167  int maxTotalClientSlots() const;
171  const QString& motd() const;
172  void setMotd(const QString& motd);
173 
174  const QString& name() const;
175  void setName(const QString& name);
176 
188  QVariant option(const QString &name) const;
189  void setOption(const QString &name, const QVariant &value);
190 
191  unsigned short port() const;
192  void setPort(unsigned short port);
193 
194  QList<bool>& pwadsOptional();
195  const QList<bool>& pwadsOptional() const;
196  void setPwadsOptional(const QList<bool>& pwadsOptional);
197 
198  QStringList& pwadsPaths();
199  const QStringList& pwadsPaths() const;
200  void setPwadsPaths(const QStringList& pwadsPaths);
201 
205  QList<PWad> pwads() const;
206 
210  QStringList pwadsNames() const;
211 
215  const QString& rconPassword() const;
216  void setRconPassword(const QString& pass);
217 
221  int skill() const;
222  void setSkill(int skill);
223 
227  const QString& url() const;
228  void setUrl(const QString& url);
229 
233  bool upnp() const;
234  void setUpnp(bool upnp);
235 
242  quint16 upnpPort() const;
243  void setUpnpPort(quint16 port);
244 
245  private:
247 };
248 
249 
250 
251 #endif // header
Game parametrization data used when creating new games.
PWAD hosted on a server.
A group of DMFlag objects that can be safely OR&#39;ed together to form a meaningful value.
Game mode representation.
A general game setting or variable (like fraglimit).