core/CConVarManager.h
changeset 457 9b8a85bf4175
child 464 765517f654a5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/core/CConVarManager.h	Thu Feb 08 21:41:28 2007 +0000
     1.3 @@ -0,0 +1,54 @@
     1.4 +/**
     1.5 +* ===============================================================
     1.6 +* SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     1.7 +* ===============================================================
     1.8 +*
     1.9 +* This file is not open source and may not be copied without explicit
    1.10 +* written permission of AlliedModders LLC.  This file may not be redistributed 
    1.11 +* in whole or significant part.
    1.12 +* For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    1.13 +*
    1.14 +* Version: $Id$
    1.15 +*/
    1.16 +
    1.17 +#ifndef _INCLUDE_SOURCEMOD_CCONVARMANAGER_H_
    1.18 +#define _INCLUDE_SOURCEMOD_CCONVARMANAGER_H_
    1.19 +
    1.20 +#include "sm_globals.h"
    1.21 +#include "sourcemm_api.h"
    1.22 +#include "HandleSys.h"
    1.23 +#include "sm_trie.h"
    1.24 +#include <IRootConsoleMenu.h>
    1.25 +
    1.26 +class CConVarManager :
    1.27 +	public SMGlobalClass,
    1.28 +	public IHandleTypeDispatch,
    1.29 +	public IRootConsoleCommand
    1.30 +{
    1.31 +public:
    1.32 +	CConVarManager();
    1.33 +	~CConVarManager();
    1.34 +public: // SMGlobalClass
    1.35 +	void OnSourceModAllInitialized();
    1.36 +	void OnSourceModShutdown();
    1.37 +public: // IHandleTypeDispatch
    1.38 +	void OnHandleDestroy(HandleType_t type, void *object);
    1.39 +public: //IRootConsoleCommand
    1.40 +	void OnRootConsoleCommand(const char *command, unsigned int argcount);
    1.41 +public:
    1.42 +	inline HandleType_t GetHandleType()
    1.43 +	{
    1.44 +		return m_ConVarType;
    1.45 +	}
    1.46 +public:
    1.47 +	Handle_t CreateConVar(IPluginContext *pContext, const char *name, const char *defaultVal, const char *helpText,
    1.48 +	                      int flags, bool hasMin, float min, bool hasMax, float max);
    1.49 +	Handle_t FindConVar(const char* name);
    1.50 +private:
    1.51 +	HandleType_t m_ConVarType;
    1.52 +	Trie *m_CvarCache;
    1.53 +};
    1.54 +
    1.55 +extern CConVarManager g_ConVarManager;
    1.56 +
    1.57 +#endif // _INCLUDE_SOURCEMOD_CCONVARMANAGER_H_
    1.58 \ No newline at end of file