3 * ===============================================================
4 * SourceMod, Copyright (C) 2004-2007 AlliedModders LLC.
6 * ===============================================================
8 * This file is part of the SourceMod/SourcePawn SDK. This file may only be
9 * used or modified under the Terms and Conditions of its License Agreement,
10 * which is found in public/licenses/LICENSE.txt. As of this notice, derivative
11 * works must be licensed under the GNU General Public License (version 2 or
12 * greater). A copy of the GPL is included under public/licenses/GPL.txt.
14 * To view the latest information, see: http://www.sourcemod.net/license.php
19 #ifndef _INCLUDE_SOURCEMOD_GAMEHELPERS_H_
20 #define _INCLUDE_SOURCEMOD_GAMEHELPERS_H_
22 #include <IShareSys.h>
24 #include <server_class.h>
28 #define SMINTERFACE_GAMEHELPERS_NAME "IGameHelpers"
29 #define SMINTERFACE_GAMEHELPERS_VERSION 1
32 * @file IGameHelpers.h
33 * @brief Provides Source helper functions.
38 class IGameHelpers : public SMInterface
41 virtual const char *GetInterfaceName()
43 return SMINTERFACE_GAMEHELPERS_NAME;
45 virtual unsigned int GetInterfaceVersion()
47 return SMINTERFACE_GAMEHELPERS_VERSION;
51 * @brief Finds a send property in a named send table.
53 * @param classname Top-level sendtable name.
54 * @param offset Property name.
55 * @return SendProp pointer on success, NULL on failure.
57 virtual SendProp *FindInSendTable(const char *classname, const char *offset) =0;
60 * @brief Finds a named server class.
62 * @return ServerClass pointer on success, NULL on failure.
64 virtual ServerClass *FindServerClass(const char *classname) =0;
67 * @brief Finds a datamap_t definition.
69 * @param pMap datamap_t pointer.
70 * @param offset Property name.
71 * @return typedescription_t pointer on success, NULL
74 virtual typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset) =0;
77 * @brief Retrieves an entity's datamap_t pointer.
79 * @param pEntity CBaseEntity entity.
80 * @return datamap_t pointer, or NULL on failure.
82 virtual datamap_t *GetDataMap(CBaseEntity *pEntity) =0;
85 * @brief Marks an edict as state changed for an offset.
87 * @param pEdict Edict pointer.
88 * @param offset Offset index.
90 virtual void SetEdictStateChanged(edict_t *pEdict, unsigned short offset) =0;
93 * @brief Sends a text message to a client.
95 * @param client Client index.
96 * @param dest Destination on the HUD.
97 * @param msg Message to send.
98 * @return True on success, false on failure.
100 virtual bool TextMsg(int client, int dest, const char *msg) =0;
104 #endif //_INCLUDE_SOURCEMOD_GAMEHELPERS_H_