BVB Source Codes

CRYENGINE Show FlowDelayNode.h Source code

Return Download CRYENGINE: download FlowDelayNode.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #pragma once
  4.  
  5. #include <queue>
  6. #include <CryFlowGraph/IFlowBaseNode.h>
  7.  
  8. class CFlowDelayNode : public CFlowBaseNode<eNCT_Instanced>
  9. {
  10. public:
  11.         CFlowDelayNode(SActivationInfo*);
  12.         virtual ~CFlowDelayNode();
  13.  
  14.         // IFlowNode
  15.         virtual IFlowNodePtr Clone(SActivationInfo*);
  16.         virtual void         GetConfiguration(SFlowNodeConfig&);
  17.         virtual void         ProcessEvent(EFlowEvent event, SActivationInfo*);
  18.         virtual void         Serialize(SActivationInfo*, TSerialize ser);
  19.  
  20.         virtual void         GetMemoryUsage(ICrySizer* s) const
  21.         {
  22.                 s->Add(*this);
  23.                 s->AddObject(m_activations);
  24.         }
  25.         // ~IFlowNode
  26.  
  27. protected:
  28.         // let derived classes decide how long to delay
  29.         virtual float GetDelayTime(SActivationInfo*) const;
  30.         virtual bool  GetShouldReset(SActivationInfo* pActInfo);
  31.  
  32. private:
  33.         void RemovePendingTimers();
  34.  
  35.         enum
  36.         {
  37.                 INP_IN = 0,
  38.                 INP_DELAY,
  39.                 INP_RESET_ON_EACH_INPUT
  40.         };
  41.  
  42.         SActivationInfo m_actInfo;
  43.         struct SDelayData
  44.         {
  45.                 SDelayData() {}
  46.                 SDelayData(const CTimeValue& timeout, const TFlowInputData& data)
  47.                         : m_timeout(timeout), m_data(data) {}
  48.  
  49.                 CTimeValue     m_timeout;
  50.                 TFlowInputData m_data;
  51.                 bool operator<(const SDelayData& rhs) const
  52.                 {
  53.                         return m_timeout < rhs.m_timeout;
  54.                 }
  55.  
  56.                 void Serialize(TSerialize ser)
  57.                 {
  58.                         ser.Value("m_timeout", m_timeout);
  59.                         ser.Value("m_data", m_data);
  60.                 }
  61.  
  62.                 void GetMemoryUsage(ICrySizer* pSizer) const { /*nothing*/ }
  63.         };
  64.  
  65.         typedef std::map<IGameFramework::TimerID, SDelayData> Activations;
  66.         Activations m_activations;
  67.         static void OnTimer(void* pUserData, IGameFramework::TimerID ref);
  68. };
  69.  
downloadFlowDelayNode.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