aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/cvar.h
blob: 43b13bfb37ff7826b7814ece04b6086434104cc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "convar.h"

//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class ConCommandBase;
class ConCommand;
class ConVar;

//-----------------------------------------------------------------------------
// Internals for ICVarIterator
//-----------------------------------------------------------------------------
class CCVarIteratorInternal // Fully reversed table, just look at the virtual function table and rename the function.
{
  public:
	virtual void SetFirst(void) = 0;	   // 0
	virtual void Next(void) = 0;		   // 1
	virtual bool IsValid(void) = 0;		   // 2
	virtual ConCommandBase* Get(void) = 0; // 3
};

//-----------------------------------------------------------------------------
// Default implementation
//-----------------------------------------------------------------------------
class CCvar
{
  public:
	ConCommandBase* FindCommandBase(const char* pszCommandName);
	ConVar* FindVar(const char* pszVarName);
	ConCommand* FindCommand(const char* pszCommandName);
	CCVarIteratorInternal* FactoryInternalIterator();
	std::unordered_map<std::string, ConCommandBase*> DumpToMap();
};

extern SourceInterface<CCvar>* g_pCVarInterface;
extern CCvar* g_pCVar;