BVB Source Codes

CRYENGINE Show PersonalRangeSignaling.h Source code

Return Download CRYENGINE: download PersonalRangeSignaling.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /********************************************************************
  4.    ---------------------------------------------------------------------
  5.    File name:   Range.h
  6.    $Id$
  7.    $DateTime$
  8.    Description: Manager per-actor signals to other actors by range
  9.    ---------------------------------------------------------------------
  10.    History:
  11.    - 09:04:2007 : Created by Ricardo Pillosu
  12.  
  13.  *********************************************************************/
  14. #ifndef _PERSONAL_RANGE_SIGNALING_H_
  15. #define _PERSONAL_RANGE_SIGNALING_H_
  16.  
  17. #include "AIProxy.h"
  18.  
  19. class CRangeSignaling;
  20. class CRange;
  21. class CAngleAlert;
  22.  
  23. class CPersonalRangeSignaling : public IAIProxyListener
  24. {
  25.         typedef std::vector<CRange*>          VecRanges;
  26.         typedef std::vector<CAngleAlert*>     VecAngles;
  27.         typedef std::map<EntityId, VecRanges> MapTargetRanges;
  28.  
  29. public:
  30.         // Base ----------------------------------------------------------
  31.         CPersonalRangeSignaling(CRangeSignaling* pParent);
  32.         virtual ~CPersonalRangeSignaling();
  33.         bool Init(EntityId Id);
  34.         bool Update(float fElapsedTime, uint32 uDebugOrder = 0);
  35.         void Reset();
  36.         void OnProxyReset();
  37.         void SetEnabled(bool bEnable);
  38.         bool IsEnabled() const { return m_bEnabled; }
  39.  
  40.         // Utils ---------------------------------------------------------
  41.         bool           AddRangeSignal(float fRadius, float fBoundary, const char* sSignal, IAISignalExtraData* pData = NULL);
  42.         bool           AddTargetRangeSignal(EntityId IdTarget, float fRadius, float fBoundary, const char* sSignal, IAISignalExtraData* pData = NULL);
  43.         bool           AddAngleSignal(float fAngle, float fBoundary, const char* sSignal, IAISignalExtraData* pData = NULL);
  44.         EntityId       GetEntityId() const;
  45.         IEntity*       GetEntity();
  46.         IEntity const* GetEntity() const;
  47.         IActor*        GetActor();
  48.  
  49. private:
  50.         CRange const*       GetRangeTo(const Vec3& vPos, const VecRanges& vecRangeList, bool bUseBoundary = false) const;
  51.         CRange*             SearchRange(const char* sSignal, const VecRanges& vecRangeList) const;
  52.         CAngleAlert const*  GetAngleTo(const Vec3& vPos, bool bUseBoundary = false) const;
  53.         CAngleAlert*        SearchAngle(const char* sSignal) const;
  54.         void                SendSignal(IActor* pActor, const string& sSignal, IAISignalExtraData* pData = NULL) const;
  55.         IAISignalExtraData* PrepareSignalData(IAISignalExtraData* pRequestedData) const;
  56.         void                DebugDraw(uint32 uOrder) const;
  57.         void                CheckActorRanges(IActor* pActor);
  58.         void                CheckActorTargetRanges(IActor* pActor);
  59.         void                CheckActorAngles(IActor* pActor);
  60.  
  61.         // Returns AI object of an entity
  62.         IAIObject const* GetEntityAI(EntityId entityId) const;
  63.  
  64.         // Returns AI proxy of an entity
  65.         IAIActorProxy* GetEntityAIProxy(EntityId entityId) const;
  66.  
  67.         // IAIProxyListener
  68.         void         SetListener(bool bAdd);
  69.         virtual void OnAIProxyEnabled(bool bEnabled);
  70.         // ~IAIProxyListener
  71.  
  72. private:
  73.         bool             m_bInit;
  74.         bool             m_bEnabled;
  75.         IFFont*          m_pDefaultFont;
  76.         CRangeSignaling* m_pParent;
  77.         EntityId         m_EntityId;
  78.  
  79.         VecRanges        m_vecRanges;
  80.         VecAngles        m_vecAngles;
  81.  
  82.         MapTargetRanges  m_mapTargetRanges;
  83.  
  84. private:
  85.         typedef std::map<EntityId, CRange const*>      MapRangeSignals;
  86.         typedef std::map<EntityId, CAngleAlert const*> MapAngleSignals;
  87.  
  88.         MapRangeSignals m_mapRangeSignalsSent;
  89.         MapRangeSignals m_mapTargetRangeSignalsSent;
  90.         MapAngleSignals m_mapAngleSignalsSent;
  91. };
  92. #endif // _PERSONAL_RANGE_SIGNALING_H_
  93.  
downloadPersonalRangeSignaling.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