00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __SERVER_STRUCTS_H_
00024 #define __SERVER_STRUCTS_H_
00025
00026 #include <QString>
00027 #include <QList>
00028
00029 #include "global.h"
00030
00033 class MAIN_EXPORT DMFlag
00034 {
00035 public:
00036 DMFlag(QString name, unsigned value)
00037 : name(name), value(value)
00038 {
00039 }
00040
00041 QString name;
00042 unsigned value;
00043 };
00044
00048 class MAIN_EXPORT DMFlagsSection
00049 {
00050 public:
00051 QString name;
00052 QList<DMFlag> flags;
00053 };
00054
00058 typedef QList<DMFlagsSection*> DMFlags;
00059 typedef QList<DMFlagsSection*>::iterator DMFlagsIt;
00060 typedef QList<DMFlagsSection*>::const_iterator DMFlagsItConst;
00061 typedef QList<const DMFlagsSection*> DMFlagsConst;
00062 typedef QList<const DMFlagsSection*>::iterator DMFlagsConstIt;
00063 typedef QList<const DMFlagsSection*>::const_iterator DMFlagsConstItConst;
00064
00068 class MAIN_EXPORT GameCVar
00069 {
00070 public:
00074 QString name;
00075
00079 QString consoleCommand;
00080
00081 GameCVar() {}
00082 GameCVar(QString fname, QString fconsoleCommand):name(fname),consoleCommand(fconsoleCommand) {}
00083
00084 void setValue(bool b) { b == true ? val = "1" : val = "0"; }
00085 void setValue(int i) { setValue(QString::number(i)); }
00086 void setValue(const QString& str) { val = str; }
00087
00088 const QString& value() const { return val; }
00089 bool valueBool() const { return (val.toInt() != 0); }
00090 bool valueInt() const { return val.toInt(); }
00091
00092 protected:
00093 QString val;
00094 };
00095
00099 class MAIN_EXPORT GameMode
00100 {
00101 public:
00102 enum StandardGameModeIndexes
00103 {
00104 SGMICooperative = 900,
00105 SGMIDeathmatch = 901,
00106 SGMITeamDeathmatch = 902,
00107 SGMICTF = 903,
00108 SGMIUnknown = 904
00109 };
00110
00111
00112
00113 static const GameMode COOPERATIVE;
00114 static const GameMode DEATHMATCH;
00115 static const GameMode TEAM_DEATHMATCH;
00116 static const GameMode CAPTURE_THE_FLAG;
00117 static const GameMode UNKNOWN;
00118
00122 GameMode(int index, const QString &name, bool teamgame);
00123
00124 int modeIndex() const { return gameModeIndex; }
00125 const QString &name() const { return modeName;}
00126 bool isTeamGame() const { return teamgame; }
00127 protected:
00128 int gameModeIndex;
00129 QString modeName;
00130 bool teamgame;
00131 };
00132
00133 class MAIN_EXPORT SkillLevel
00134 {
00135
00136
00137 static const int numSkillLevels;
00138 static const QString names[];
00139 };
00140
00141 #endif