BVB Source Codes

CRYENGINE Show CustomActionManager.h Source code

Return Download CRYENGINE: download CustomActionManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef _CUSTOMACTIONMANAGER_H_
  4. #define _CUSTOMACTIONMANAGER_H_
  5.  
  6. #if _MSC_VER > 1000
  7.         #pragma once
  8. #endif
  9.  
  10. #include <CryFlowGraph/IFlowSystem.h>
  11. #include <CryAction/ICustomActions.h>
  12. #include <CryCore/Containers/CryListenerSet.h>
  13. #include "CustomAction.h"
  14.  
  15. ///////////////////////////////////////////////////
  16. // CCustomActionManager keeps track of all CustomActions
  17. ///////////////////////////////////////////////////
  18. class CCustomActionManager : public ICustomActionManager
  19. {
  20. public:
  21.         CCustomActionManager();
  22.         virtual ~CCustomActionManager();
  23.  
  24. public:
  25.         // ICustomActionManager
  26.         virtual bool           StartAction(IEntity* pObject, const char* szCustomActionGraphName, ICustomActionListener* pListener = NULL);
  27.         virtual bool           SucceedAction(IEntity* pObject, const char* szCustomActionGraphName, ICustomActionListener* pListener = NULL);
  28.         virtual bool           SucceedWaitAction(IEntity* pObject);
  29.         virtual bool           SucceedWaitCompleteAction(IEntity* pObject);
  30.         virtual bool           AbortAction(IEntity* pObject);
  31.         virtual bool           EndAction(IEntity* pObject, bool bSuccess);
  32.         virtual void           LoadLibraryActions(const char* sPath);
  33.         virtual void           ClearActiveActions();
  34.         virtual void           ClearLibraryActions();
  35.         virtual size_t         GetNumberOfCustomActionsFromLibrary() const { return m_actionsLib.size(); }
  36.         virtual ICustomAction* GetCustomActionFromLibrary(const char* szCustomActionGraphName);
  37.         virtual ICustomAction* GetCustomActionFromLibrary(const size_t index);
  38.         virtual size_t         GetNumberOfActiveCustomActions() const;
  39.         virtual ICustomAction* GetActiveCustomAction(const IEntity* pObject);
  40.         virtual ICustomAction* GetActiveCustomAction(const size_t index);
  41.         virtual bool           UnregisterListener(ICustomActionListener* pEventListener);
  42.         virtual void           Serialize(TSerialize ser);
  43.         // ~ICustomActionManager
  44.  
  45.         // Removes deleted Action from the list of active actions
  46.         void Update();
  47.  
  48.         void GetMemoryUsage(ICrySizer* pSizer) const
  49.         {
  50.                 SIZER_COMPONENT_NAME(pSizer, "CustomActionManager");
  51.  
  52.                 pSizer->AddObject(this, sizeof(*this));
  53.                 pSizer->AddObject(m_actionsLib);
  54.                 pSizer->AddObject(m_activeActions);
  55.         }
  56.  
  57. protected:
  58.         // Adds an Action in the list of active actions
  59.         ICustomAction* AddActiveCustomAction(IEntity* pObject, const char* szCustomActionGraphName, ICustomActionListener* pListener = NULL);
  60.  
  61.         // Called when entity is removed
  62.         void OnEntityRemove(IEntity* pEntity);
  63.  
  64. private:
  65.         // Library of all defined Actions
  66.         typedef std::map<string, CCustomAction> TCustomActionsLib;
  67.         TCustomActionsLib m_actionsLib;
  68.  
  69.         // List of all active Actions (including suspended and to be deleted)
  70.         typedef std::list<CCustomAction> TActiveActions;
  71.         TActiveActions m_activeActions;
  72. };
  73.  
  74. #endif
  75.  
downloadCustomActionManager.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