+bool autocvar_developer_mapper;
+
+#define LOG_MAPWARN(...) MACRO_BEGIN { if (autocvar_developer_mapper) LOG_WARNING(__VA_ARGS__); } MACRO_END
+#define LOG_MAPWARNF(...) MACRO_BEGIN { if (autocvar_developer_mapper) LOG_WARNINGF(__VA_ARGS__); } MACRO_END
+
+#include "util.qh"
+
+CLASS(Gametype, Object)
+ ATTRIB(Gametype, m_id, int, 0)
+ /** game type ID */
+ ATTRIB(Gametype, items, int, 0)
+ /** game type name as in cvar (with g_ prefix) */
+ ATTRIB(Gametype, netname, string, string_null)
+ /** game type short name */
+ ATTRIB(Gametype, mdl, string, string_null)
+ /** human readable name */
+ ATTRIB(Gametype, message, string, string_null)
+ /** does this gametype support teamplay? */
+ ATTRIB(Gametype, team, bool, false)
+ /** game type defaults */
+ ATTRIB(Gametype, model2, string, string_null)
+ /** game type description */
+ ATTRIB(Gametype, gametype_description, string, string_null)
+
+ ATTRIB(Gametype, m_mutators, string, string_null)
+ ATTRIB(Gametype, m_parse_mapinfo, bool(string k, string v), func_null)
+
+ METHOD(Gametype, describe, string(Gametype this))
+ {
+ TC(Gametype, this);
+ return this.gametype_description;
+ }
+
+ METHOD(Gametype, display, void(Gametype this, void(string name, string icon) returns))
+ {
+ TC(Gametype, this);
+ returns(this.message, strcat("gametype_", this.mdl));
+ }
+
+ CONSTRUCTOR(Gametype, string hname, string sname, string g_name, bool gteamplay, string mutators, string defaults, string gdescription)
+ {
+ CONSTRUCT(Gametype);
+ this.netname = g_name;
+ this.mdl = sname;
+ this.message = hname;
+ this.team = gteamplay;
+ this.m_mutators = mutators;
+ this.model2 = defaults;
+ this.gametype_description = gdescription;
+ }
+ENDCLASS(Gametype)
+
+REGISTRY(Gametypes, BITS(4))
+#define Gametypes_from(i) _Gametypes_from(i, NULL)
+REGISTER_REGISTRY(Gametypes)
+REGISTRY_CHECK(Gametypes)