Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.7 KiB

  1. //========== Copyright � 2008, Valve Corporation, All rights reserved. ========
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef VSCRIPT_SERVER_H
  7. #define VSCRIPT_SERVER_H
  8. #include "vscript/ivscript.h"
  9. #include "tier1/keyvalues.h"
  10. #include "vscript_shared.h"
  11. #if defined( _WIN32 )
  12. #pragma once
  13. #endif
  14. class ISaveRestoreBlockHandler;
  15. bool VScriptServerReplaceClosures( const char *pszScriptName, HSCRIPT hScope, bool bWarnMissing = false );
  16. ISaveRestoreBlockHandler *GetVScriptSaveRestoreBlockHandler();
  17. class CBaseEntityScriptInstanceHelper : public IScriptInstanceHelper
  18. {
  19. bool ToString( void *p, char *pBuf, int bufSize );
  20. void *BindOnRead( HSCRIPT hInstance, void *pOld, const char *pszId );
  21. };
  22. extern CBaseEntityScriptInstanceHelper g_BaseEntityScriptInstanceHelper;
  23. // Only allow scripts to create entities during map initialization
  24. bool IsEntityCreationAllowedInScripts( void );
  25. // ----------------------------------------------------------------------------
  26. // KeyValues access
  27. // ----------------------------------------------------------------------------
  28. class CScriptKeyValues
  29. {
  30. public:
  31. CScriptKeyValues( KeyValues *pKeyValues = NULL );
  32. ~CScriptKeyValues( );
  33. HSCRIPT ScriptFindKey( const char *pszName );
  34. HSCRIPT ScriptGetFirstSubKey( void );
  35. HSCRIPT ScriptGetNextKey( void );
  36. int ScriptGetKeyValueInt( const char *pszName );
  37. float ScriptGetKeyValueFloat( const char *pszName );
  38. const char *ScriptGetKeyValueString( const char *pszName );
  39. bool ScriptIsKeyValueEmpty( const char *pszName );
  40. bool ScriptGetKeyValueBool( const char *pszName );
  41. void ScriptReleaseKeyValues( );
  42. KeyValues *m_pKeyValues; // actual KeyValue entity
  43. };
  44. #endif // VSCRIPT_SERVER_H