sourcemm/concommands.h
author Scott Ehlert <ds@alliedmods.net>
Mon Apr 17 19:42:55 2006 +0000 (2006-04-17)
changeset 187 d81c2fc9a708
parent 175 b497b7777f6b
child 192 47649a1d49e3
permissions -rw-r--r--
Fixed a warning in stub and sample :|
     1 /* ======== SourceMM ========
     2 * Copyright (C) 2004-2006 Metamod:Source Development Team
     3 * No warranties of any kind
     4 *
     5 * License: zlib/libpng
     6 *
     7 * Author(s): David "BAILOPAN" Anderson
     8 * ============================
     9 */
    10 
    11 #ifndef _INCLUDE_CONCOMMANDS_H
    12 #define _INCLUDE_CONCOMMANDS_H
    13 
    14 /**
    15  * @brief Header for console commands
    16  * @file concommands.h
    17  */
    18 
    19 #include <interface.h>
    20 #include <eiface.h>
    21 #include "sourcemm.h"
    22 #include <convar.h>
    23 #include "sh_list.h"
    24 
    25 class SMConVarAccessor : public IConCommandBaseAccessor
    26 {
    27 	SourceHook::List<ConCommandBase*> m_RegisteredCommands;
    28 public:
    29 	virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
    30 	bool Register(ConCommandBase *pCommand);
    31 	void MarkCommandsAsGameDLL();
    32 	void Unregister(ConCommandBase *pCommand);
    33 	void UnregisterGameDLLCommands();
    34 };
    35 
    36 class CAlwaysRegisterableCommand : public ConCommandBase
    37 {
    38 	ICvar *m_pICvar;
    39 public:
    40 	CAlwaysRegisterableCommand();
    41 	bool IsRegistered( void ) const;
    42 	// If already registered, removes us
    43 	// Then it registers us again
    44 	void BringToFront();
    45 };
    46 
    47 const char *GetPluginsFile();
    48 
    49 extern SMConVarAccessor g_SMConVarAccessor;
    50 
    51 #endif //_INCLUDE_CONCOMMANDS_H