All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions | Variables
gamemode.cpp File Reference
#include <ctype.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "inexor/gamemode/gamemode.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_vector.hpp"


bool searchmodename (const char *haystack, const char *needle)
int genmodemask (vector< char * > &modes)
 shortens a list of mode groups ("[<operator>]<modetype>") into a bitmask. More...
const char * modename (int n, const char *unknown)
 Returns the name of the gamemode number n. More...


int gamemode = 0
 The currently set gamemode. More...

Function Documentation

int genmodemask ( vector< char * > &  modes)

shortens a list of mode groups ("[<operator>]<modetype>") into a bitmask.

Input may be "?ctf" "!?collect" "*capture" which would do: operator ? adds this to the bitmask (so ctf modes are added) operator !? means AND (so after the second entry got evaluated only modes which are ctf AND collect modes are left) operator * is equivalent to add this if its not edit mode or anything local. operator ! means REVERT (so "?ctf", "!instactf" means all ctf-gamemodes but instactf) Input could also be the gamemode number (e.g. "21", "3") or the gamemode name ("ctf", "collect")

References gamemodes, loopk, loopv, m_checknot, M_DEMO, M_EDIT, m_valid, NUMGAMEMODES, and searchmodename().

Referenced by server::addmaprotations(), and server::addteamkillkick().

const char* modename ( int  n,
const char *  unknown = "unknown" 

Returns the name of the gamemode number n.

If n does not specify a correct gamemode, it returns the "unknown" string.

References gamemodes, m_valid, and gamemodeinfo::name.

Referenced by server::adddemo(), game::getclientmode(), game::renderscoreboard(), game::startgame(), and server::vote().

bool searchmodename ( const char *  haystack,
const char *  needle 

Referenced by genmodemask().

Variable Documentation

int gamemode = 0