BVB Source Codes

CRYENGINE Show FlowPrefabNodes.h Source code

Return Download CRYENGINE: download FlowPrefabNodes.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  File name:   FlowPrefabNodes.h
  5. //  Version:     v1.00
  6. //  Created:     11/6/2012 by Dean Claassen
  7. //  Compilers:   Visual Studio.NET 2010
  8. //  Description: Prefab flownode functionality
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #pragma once
  15.  
  16. #include <CryAction/ICustomEvents.h>
  17. #include <CryFlowGraph/IFlowBaseNode.h>
  18.  
  19. //////////////////////////////////////////////////////////////////////////
  20. // Prefab:EventSource node
  21. // This node is placed inside a prefab flowgraph to create / handle a custom event
  22. //////////////////////////////////////////////////////////////////////////
  23. class CFlowNode_PrefabEventSource : public CFlowBaseNode<eNCT_Instanced>, public ICustomEventListener
  24. {
  25. public:
  26.         enum INPUTS
  27.         {
  28.                 EIP_PrefabName = 0,
  29.                 EIP_InstanceName,
  30.                 EIP_EventName,
  31.                 EIP_EventType,
  32.                 EIP_FireEvent,
  33.                 EIP_EventId,
  34.                 EIP_EventIndex,
  35.         };
  36.  
  37.         enum OUTPUTS
  38.         {
  39.                 EOP_EventFired = 0,
  40.         };
  41.  
  42.         CFlowNode_PrefabEventSource(SActivationInfo* pActInfo)
  43.                 : m_eventId(CUSTOMEVENTID_INVALID)
  44.         {
  45.         }
  46.  
  47.         ~CFlowNode_PrefabEventSource();
  48.  
  49.         virtual void GetMemoryUsage(ICrySizer* s) const override
  50.         {
  51.                 s->Add(*this);
  52.         }
  53.  
  54.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo) override { return new CFlowNode_PrefabEventSource(pActInfo); }
  55.  
  56.         virtual void         GetConfiguration(SFlowNodeConfig& config) override;
  57.         virtual void         ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) override;
  58.  
  59.         // ICustomEventListener
  60.         virtual void OnCustomEvent(const TCustomEventId eventId, const TFlowInputData& customData) override;
  61.         // ~ICustomEventListener
  62.  
  63. private:
  64.         SActivationInfo m_actInfo;
  65.         TCustomEventId  m_eventId;
  66. };
  67.  
  68. //////////////////////////////////////////////////////////////////////////
  69. // Prefab:Instance node
  70. // This node represents a prefab instance (Currently used to handle events specific to a prefab instance)
  71. //////////////////////////////////////////////////////////////////////////
  72. class CFlowNode_PrefabInstance : public CFlowBaseNode<eNCT_Instanced>, public ICustomEventListener
  73. {
  74. public:
  75.         enum { ePrefabInstance_NumInputPortsPerEvent = 3 };
  76.         enum { ePrefabInstance_NumOutputPortsPerEvent = 1 };
  77.  
  78.         enum INPUTS
  79.         {
  80.                 EIP_PrefabName = 0,
  81.                 EIP_InstanceName,
  82.                 EIP_Event1,
  83.                 EIP_Event1Id,
  84.                 EIP_Event1Name,
  85.                 // ... reserved ports
  86.                 EIP_EventLastPort = EIP_Event1 + (CUSTOMEVENTS_PREFABS_MAXNPERINSTANCE * ePrefabInstance_NumInputPortsPerEvent),
  87.         };
  88.  
  89.         enum OUTPUTS
  90.         {
  91.                 EOP_Event1        = 0,
  92.                 // ... reserved ports
  93.                 EOP_EventLastPort = EOP_Event1 + (CUSTOMEVENTS_PREFABS_MAXNPERINSTANCE * ePrefabInstance_NumOutputPortsPerEvent),
  94.         };
  95.  
  96.         CFlowNode_PrefabInstance(SActivationInfo* pActInfo);
  97.         ~CFlowNode_PrefabInstance();
  98.  
  99.         virtual void GetMemoryUsage(ICrySizer* s) const override
  100.         {
  101.                 s->Add(*this);
  102.         }
  103.  
  104.         virtual IFlowNodePtr Clone(SActivationInfo* pActInfo) override { return new CFlowNode_PrefabInstance(pActInfo); }
  105.  
  106.         virtual void         GetConfiguration(SFlowNodeConfig& config) override;
  107.         virtual void         ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo) override;
  108.  
  109.         // ICustomEventListener
  110.         virtual void OnCustomEvent(const TCustomEventId eventId, const TFlowInputData& customData) override;
  111.         // ~ICustomEventListener
  112.  
  113. private:
  114.         CryFixedArray<TCustomEventId, CUSTOMEVENTS_PREFABS_MAXNPERINSTANCE> m_eventIds;
  115.         SActivationInfo m_actInfo;
  116. };
  117.  
downloadFlowPrefabNodes.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