sourcemm/concommands.h
author David Anderson <dvander@alliedmods.net>
Fri Jun 24 22:39:58 2005 +0000 (2005-06-24)
changeset 78 b5dc5deb71b8
parent 67 1753f7a9b2f2
child 89 79be0cd8f6c9
permissions -rw-r--r--
Added changelog file
     1 /* ======== SourceMM ========
     2 * Copyright (C) 2004-2005 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 <list>
    24 
    25 class SMConVarAccessor : public IConCommandBaseAccessor
    26 {
    27 	std::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 };
    34 
    35 class CAlwaysRegisterableCommand : public ConCommandBase
    36 {
    37 	ICvar *m_pICvar;
    38 public:
    39 	CAlwaysRegisterableCommand();
    40 	bool IsRegistered( void ) const;
    41 	// If already registered, removes us
    42 	// Then it registers us again
    43 	void BringToFront();
    44 };
    45 
    46 extern SMConVarAccessor g_SMConVarAccessor;
    47 
    48 #endif //_INCLUDE_CONCOMMANDS_H