BVB Source Codes

CRYENGINE Show GameRulesSystem.h Source code

Return Download CRYENGINE: download GameRulesSystem.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description:
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 15:9:2004   10:30 : Created by Mathieu Pinard
  12.    - 20:10:2004   10:30 : Added IGameRulesSystem interface (Craig Tiller)
  13.  
  14. *************************************************************************/
  15. #ifndef __GAMERULESYSTEM_H__
  16. #define __GAMERULESYSTEM_H__
  17.  
  18. #if _MSC_VER > 1000
  19.         #pragma once
  20. #endif
  21.  
  22. #include "IGameRulesSystem.h"
  23.  
  24. class CGameServerNub;
  25.  
  26. class CGameRulesSystem : public IGameRulesSystem
  27. {
  28.         typedef struct SGameRulesDef
  29.         {
  30.                 string              extension;
  31.                 std::vector<string> aliases;
  32.                 std::vector<string> maplocs;
  33.  
  34.                 void GetMemoryUsage(ICrySizer* pSizer) const
  35.                 {
  36.                         pSizer->AddObject(extension);
  37.                         pSizer->AddObject(aliases);
  38.                         pSizer->AddObject(maplocs);
  39.                 }
  40.         }SGameRulesDef;
  41.  
  42.         typedef std::map<string, SGameRulesDef> TGameRulesMap;
  43. public:
  44.         CGameRulesSystem(ISystem* pSystem, IGameFramework* pGameFW);
  45.         ~CGameRulesSystem();
  46.  
  47.         void                Release() { delete this; };
  48.  
  49.         virtual bool        RegisterGameRules(const char* rulesName, const char* extensionName, bool bUseScript);
  50.         virtual bool        CreateGameRules(const char* rulesName);
  51.         virtual bool        DestroyGameRules();
  52.         virtual bool        HaveGameRules(const char* rulesName);
  53.  
  54.         virtual void        AddGameRulesAlias(const char* gamerules, const char* alias);
  55.         virtual void        AddGameRulesLevelLocation(const char* gamerules, const char* mapLocation);
  56.         virtual const char* GetGameRulesLevelLocation(const char* gamerules, int i);
  57.  
  58.         virtual void        SetCurrentGameRules(IGameRules* pGameRules);
  59.         virtual IGameRules* GetCurrentGameRules() const;
  60.         const char*         GetGameRulesName(const char* alias) const;
  61.  
  62.         void                GetMemoryStatistics(ICrySizer* s);
  63.  
  64. private:
  65.         SGameRulesDef*           GetGameRulesDef(const char* name);
  66.         static IEntityComponent* CreateGameObject(
  67.           IEntity* pEntity, SEntitySpawnParams& params, void* pUserData);
  68.  
  69.         IGameFramework* m_pGameFW;
  70.  
  71.         EntityId        m_currentGameRules;
  72.         IGameRules*     m_pGameRules;
  73.  
  74.         TGameRulesMap   m_GameRules;
  75. };
  76.  
  77. #endif // __GAMERULESYSTEM_H__
  78.  
downloadGameRulesSystem.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