gamecreateparams.h
1 //------------------------------------------------------------------------------
2 // gamecreateparams.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program 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
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; 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 
41 class MAIN_EXPORT GameCreateParams
42 {
43  public:
44  enum HostMode
45  {
46  Host,
47  Offline,
48  Demo
49  };
50 
53 
57  const QString& connectPassword() const;
58 
59  QStringList& customParameters();
60  const QStringList& customParameters() const;
65  QList<GameCVar>& cvars();
66  const QList<GameCVar>& cvars() const;
67 
85  const QString& demoPath() const;
92  const GameDemo &demoRecord() const;
93  void setDemoRecord(const GameDemo &demo);
94 
95 
96  QList<DMFlagsSection>& dmFlags();
97  const QList<DMFlagsSection>& dmFlags() const;
98  const QString& email() const;
102  const QString& executablePath() const;
103  const GameMode& gameMode() const;
104  HostMode hostMode() const;
105 
106  bool isBroadcastToLan() const;
107  bool isBroadcastToMaster() const;
108  bool isRandomMapRotation() const;
109 
113  const QString& ingamePassword() const;
114  const QString& iwadPath() const;
115 
119  QString iwadName() const;
120 
124  const QString& map() const;
128  const QStringList& mapList() const;
129  int maxClients() const;
130  int maxPlayers() const;
135  int maxTotalClientSlots() const;
139  const QString& motd() const;
140  const QString& name() const;
141  unsigned short port() const;
142  QList<bool>& pwadsOptional();
143  const QList<bool>& pwadsOptional() const;
144  QStringList& pwadsPaths();
145  const QStringList& pwadsPaths() const;
146 
150  QStringList pwadsNames() const;
151 
155  const QString& rconPassword() const;
156 
157  void setBroadcastToLan(bool b);
158  void setBroadcastToMaster(bool b);
159  void setConnectPassword(const QString& pass);
160  void setCustomParameters(const QStringList& customParameters);
161  void setCvars(const QList<GameCVar>& cvars);
162  void setDemoPath(const QString& demoPath);
163  void setEmail(const QString& email);
164  void setExecutablePath(const QString& executablePath);
165  void setGameMode(const GameMode& mode);
166  void setHostMode(HostMode mode);
167  void setIngamePassword(const QString& pass);
168  void setIwadPath(const QString& iwadPath);
169  void setMap(const QString& map);
170  void setMapList(const QStringList& mapList);
171  void setMaxClients(int num);
172  void setMaxPlayers(int num);
173  void setMotd(const QString& motd);
174  void setName(const QString& name);
175  void setPort(unsigned short port);
176  void setPwadsOptional(const QList<bool>& pwadsOptional);
177  void setPwadsPaths(const QStringList& pwadsPaths);
178  void setRandomMapRotation(bool b);
179  void setRconPassword(const QString& pass);
180  void setSkill(int skill);
181  void setUrl(const QString& url);
182 
186  int skill() const;
190  const QString& url() const;
191 
192  private:
194 };
195 
196 #endif // header
Game parametrization data used when creating new games.
A group of DMFlag objects that can be safely OR'ed together to form a meaningful value.
Definition: serverstructs.h:86
Game mode representation.
A general game setting or variable (like fraglimit).