2
0
mirror of https://github.com/rehlds/metamod-r.git synced 2025-01-05 19:45:46 +03:00
metamod-r/metamod/src/mplayer.h

34 lines
997 B
C
Raw Normal View History

2016-07-26 19:31:47 +03:00
#pragma once
2016-07-26 03:22:47 +03:00
2016-07-26 19:31:47 +03:00
#include "types_meta.h"
2016-07-26 03:22:47 +03:00
// Info on an individual player
class MPlayer
2016-07-26 03:22:47 +03:00
{
public:
MPlayer();
2016-07-26 19:31:47 +03:00
void set_cvar_query(const char *cvar); // mark this player as querying a client cvar
void clear_cvar_query(const char *cvar = nullptr); // unmark this player as querying a client cvar
const char *is_querying_cvar() const; // check if a player is querying a cvar. returns
private:
2016-07-30 02:03:01 +03:00
bool isQueried; // is this player currently queried for a cvar value
2016-07-26 19:31:47 +03:00
char cvarName[64]; // name of the cvar if getting queried
2016-07-26 03:22:47 +03:00
};
// A list of players. The number of max players is fixed and small enough
// to use an array.
class MPlayerList
2016-07-26 19:31:47 +03:00
{
2016-07-26 03:22:47 +03:00
public:
2016-07-26 19:31:47 +03:00
void set_player_cvar_query(const edict_t *pEntity, const char *cvar);
void clear_player_cvar_query(const edict_t *pEntity, const char *cvar = nullptr);
void clear_all_cvar_queries();
const char *is_querying_cvar(const edict_t *pEntity) const;
private:
int maxplayers = 32;
2016-07-26 19:31:47 +03:00
MPlayer players[MAX_CLIENTS + 1]; // array of players
2016-07-26 03:22:47 +03:00
};