core/sm_globals.h
author David Anderson <dvander@alliedmods.net>
Fri Mar 02 08:34:13 2007 +0000 (2007-03-02)
changeset 558 fc0eec032efb
parent 455 6d3a8434ac65
child 653 ef60870067ff
permissions -rw-r--r--
added state change function
     1 /**
     2  * ===============================================================
     3  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     4  * ===============================================================
     5  *
     6  * This file is not open source and may not be copied without explicit
     7  * written permission of AlliedModders LLC.  This file may not be redistributed 
     8  * in whole or significant part.
     9  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    10  *
    11  * Version: $Id$
    12  */
    13 
    14 #ifndef _INCLUDE_SOURCEMOD_GLOBALS_H_
    15 #define _INCLUDE_SOURCEMOD_GLOBALS_H_
    16 
    17 /**
    18  * @file Contains global headers that most files in SourceMod will need.
    19  */
    20 
    21 #include <sp_vm_types.h>
    22 #include <sp_vm_api.h>
    23 #include "sm_platform.h"
    24 #include <IShareSys.h>
    25 
    26 using namespace SourcePawn;
    27 using namespace SourceMod;
    28 
    29 /** 
    30  * @brief Any class deriving from this will be automatically initiated/shutdown by SourceMod
    31  */
    32 class SMGlobalClass
    33 {
    34 	friend class SourceModBase;
    35 public:
    36 	SMGlobalClass();
    37 public:
    38 	/**
    39 	 * @brief Called when SourceMod is initially loading
    40 	 */
    41 	virtual void OnSourceModStartup(bool late)
    42 	{
    43 	}
    44 
    45 	/**
    46 	 * @brief Called after all global classes have initialized
    47 	 */
    48 	virtual void OnSourceModAllInitialized()
    49 	{
    50 	}
    51 
    52 	/**
    53 	 * @brief Called when SourceMod is shutting down
    54 	 */
    55 	virtual void OnSourceModShutdown()
    56 	{
    57 	}
    58 
    59 	/**
    60 	* @brief Called after SourceMod is completely shut down
    61 	*/
    62 	virtual void OnSourceModAllShutdown()
    63 	{
    64 	}
    65 private:
    66 	SMGlobalClass *m_pGlobalClassNext;
    67 	static SMGlobalClass *head;
    68 };
    69 
    70 extern ISourcePawnEngine *g_pSourcePawn;
    71 extern IVirtualMachine *g_pVM;
    72 extern IdentityToken_t *g_pCoreIdent;
    73 
    74 #include "sm_autonatives.h"
    75 
    76 #endif //_INCLUDE_SOURCEMOD_GLOBALS_H_