BVB Source Codes

CRYENGINE Show DialogQueuesManager.h Source code

Return Download CRYENGINE: download DialogQueuesManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __DIALOGQUEUESMANAGER_H__
  4. #define __DIALOGQUEUESMANAGER_H__
  5.  
  6. class CDialogSession;
  7.  
  8. #include <CryCore/StlUtils.h>
  9. #include <CryNetwork/ISerialize.h>
  10. #include <CryNetwork/ISerializeHelper.h>
  11.  
  12. #ifndef _RELEASE
  13.         #define DEBUGINFO_DIALOGBUFFER
  14. #endif
  15.  
  16. // this works like a 'buffered channel' feature:.
  17. // - Dialogs can be assigned to a buffer.
  18. // - When a dialog that is being played is assigned to a buffer, any other dialog that tries to play through that buffer is hold in a waiting list, until all previous ones finish
  19. class CDialogQueuesManager
  20. {
  21. public:
  22.         typedef int TDialogId;
  23.  
  24.         CDialogQueuesManager();
  25.         void      Reset();
  26.         TDialogId Play(uint32 queueID, const string& name);
  27.         bool      IsDialogWaiting(uint32 queueID, TDialogId dialogId);
  28.         void      NotifyDialogDone(uint32 queueID, TDialogId dialogId);
  29.         uint32    BufferEnumToId(uint32 queueEnum); // queue enum means the values stored in the .xml definition file
  30.         bool      IsBufferFree(uint32 queueID);
  31.         void      Serialize(TSerialize ser);
  32.         void      Update();
  33.  
  34.         static const uint32 NO_QUEUE = (uint32) - 1;  //use this special queueID to mark dialogs outside of the queuing system (will always be played)
  35.  
  36. private:
  37.  
  38.         TDialogId CreateNewDialogId()                  { CryInterlockedIncrement(&m_uniqueDialogID); return m_uniqueDialogID; }
  39.         bool      IsQueueIDValid(uint32 queueID) const { return queueID < m_numBuffers; }  //Will return false for "no_queue" dialogs, which causes the dialog not to be queued, but to be started directly
  40.  
  41.         typedef std::vector<uint32>  TBuffer;
  42.         typedef std::vector<TBuffer> TBuffersList;
  43.  
  44.         TBuffersList m_buffersList;
  45.         uint32       m_numBuffers;     // == m_buffersList.size().
  46.         int          m_uniqueDialogID; // dialog ids come from increasing this
  47.  
  48. #ifdef DEBUGINFO_DIALOGBUFFER
  49.         typedef std::vector<string>         TBufferNames;
  50.         typedef std::map<TDialogId, string> TDialogNames;
  51.         TBufferNames m_bufferNames;
  52.         TDialogNames m_dialogNames;
  53. #endif
  54. };
  55.  
  56. #endif
  57.  
downloadDialogQueuesManager.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