BVB Source Codes

CRYENGINE Show ScriptBind_GameStatistics.h Source code

Return Download CRYENGINE: download ScriptBind_GameStatistics.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef   __SCRIPTBIND_GAMESTATISTICS_H__
  4. #define   __SCRIPTBIND_GAMESTATISTICS_H__
  5.  
  6. #if _MSC_VER > 1000
  7.         #pragma once
  8. #endif
  9.  
  10. #include <CryScriptSystem/IScriptSystem.h>
  11. #include <CryScriptSystem/ScriptHelpers.h>
  12.  
  13. #define STATISTICS_CHECK_BINDING 1
  14.  
  15. struct IStatsTracker;
  16. class CGameStatistics;
  17.  
  18. class CScriptBind_GameStatistics : public CScriptableBase
  19. {
  20. public:
  21.         CScriptBind_GameStatistics(CGameStatistics* pGS);
  22.         virtual ~CScriptBind_GameStatistics();
  23.  
  24.         virtual void GetMemoryUsage(ICrySizer* pSizer) const
  25.         {
  26.                 pSizer->AddObject(this, sizeof(*this));
  27. #if STATISTICS_CHECK_BINDING
  28.                 pSizer->AddObject(m_boundTrackers);
  29. #endif
  30.         }
  31.  
  32.         //! <code>GameStatistics.PushGameScope(scopeID)</code>
  33.         //!             <param name="scopeID">identifier of the scope to be placed on top of the stack.</param>
  34.         //! <description>Pushes a scope on top of the stack.</description>
  35.         virtual int PushGameScope(IFunctionHandler* pH, int scopeID);
  36.  
  37.         //! <code>GameStatistics.PopGameScope( [checkScopeId] )</code>
  38.         //!             <param name="checkScopeId">(optional)</param>
  39.         //! <description>Removes the scope from the top of the stack.</description>
  40.         virtual int PopGameScope(IFunctionHandler* pH);
  41.  
  42.         //! <code>GameStatistics.CurrentScope()</code>
  43.         //! <description>Returns the ID of current scope, -1 if stack is empty.</description>
  44.         virtual int CurrentScope(IFunctionHandler* pH);
  45.  
  46.         //! <code>GameStatistics.AddGameElement( scopeID, elementID, locatorID, locatorValue [, table])</code>
  47.         //! <description>Adds a game element to specified scope.</description>
  48.         virtual int AddGameElement(IFunctionHandler* pH);
  49.  
  50.         //! <code>GameStatistics.RemoveGameElement( scopeID, elementID, locatorID, locatorValue )</code>
  51.         //! <description>Removes element from the specified scope if data parameters match.</description>
  52.         virtual int RemoveGameElement(IFunctionHandler* pH);
  53.  
  54.         //! <code>GameStatistics.Event()</code>
  55.         virtual int Event(IFunctionHandler* pH);
  56.  
  57.         //! <code>GameStatistics.StateValue( )</code>
  58.         virtual int StateValue(IFunctionHandler* pH);
  59.  
  60.         //! <code>GameStatistics.BindTracker( name, tracker )</code>
  61.         bool BindTracker(IScriptTable* pT, const char* name, IStatsTracker* tracker);
  62.  
  63.         //! <code>GameStatistics.UnbindTracker( name, tracker )</code>
  64.         bool UnbindTracker(IScriptTable* pT, const char* name, IStatsTracker* tracker);
  65.  
  66. private:
  67.         void                    RegisterMethods();
  68.         void                    RegisterGlobals();
  69.         static IStatsTracker*   GetTracker(IFunctionHandler* pH);
  70.         static IGameStatistics* GetStats(IFunctionHandler* pH);
  71.  
  72.         //CScriptableBase m_StatsTracker; //[FINDME][SergeyR]: ctor is protected
  73.         CGameStatistics* m_pGS;
  74.         IScriptSystem*   m_pSS;
  75.  
  76. #if STATISTICS_CHECK_BINDING
  77.         std::set<IStatsTracker*> m_boundTrackers;
  78. #endif
  79. };
  80.  
  81. #endif //__SCRIPTBIND_GAMESTATISTICS_H__
  82.  
downloadScriptBind_GameStatistics.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top