BVB Source Codes

CRYENGINE Show UnitAction.h Source code

Return Download CRYENGINE: download UnitAction.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:   UnitAction.h
  6.    $Id$
  7.    Description: refactoring - moved out of LeaderAction.h
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 3:6:2005   9:56 : Created by Kirill Bulatsev
  12.     serialization support for unitaction/unitimg
  13.  
  14.  *********************************************************************/
  15.  
  16. #ifndef __UnitAction_H__
  17. #define __UnitAction_H__
  18.  
  19. #if _MSC_VER > 1000
  20.         #pragma once
  21. #endif
  22.  
  23. #include <CryNetwork/ISerialize.h>
  24. #include <list>
  25. #include "AISignal.h"
  26.  
  27. enum EPriority
  28. {
  29.         PRIORITY_VERY_LOW = 1,
  30.         PRIORITY_LOW,
  31.         PRIORITY_NORMAL,
  32.         PRIORITY_HIGH,
  33.         PRIORITY_VERY_HIGH,
  34.         PRIORITY_LAST // make sure this one is always the last!
  35. };
  36.  
  37. enum  EUnitAction
  38. {
  39.         UA_NONE,
  40.         UA_SIGNAL,
  41.         UA_SEARCH,
  42.         UA_ACQUIRETARGET,
  43.         UA_LAST,  // make sure this one is always the last!
  44. };
  45.  
  46. struct AISignalExtraData;
  47. class CUnitAction;
  48.  
  49. typedef std::list<CUnitAction*> TActionList;
  50. typedef std::list<CUnitAction*> TActionListRef;
  51.  
  52. class CUnitAction
  53. {
  54. public:
  55.         CUnitAction();
  56.         CUnitAction(EUnitAction eAction, bool bBlocking);
  57.         CUnitAction(EUnitAction eAction, bool bBlocking, const Vec3& point);
  58.         CUnitAction(EUnitAction eAction, bool bBlocking, const Vec3& point, const Vec3& dir);
  59.         CUnitAction(EUnitAction eAction, bool bBlocking, float fDistance);
  60.         CUnitAction(EUnitAction eAction, bool bBlocking, const char* szText);
  61.         CUnitAction(EUnitAction eAction, bool bBlocking, const char* szText, const AISignalExtraData& data);
  62.         CUnitAction(EUnitAction eAction, bool bBlocking, int priority);
  63.         CUnitAction(EUnitAction eAction, bool bBlocking, int priority, const Vec3& point);
  64.         CUnitAction(EUnitAction eAction, bool bBlocking, int priority, const char* szText);
  65.         CUnitAction(EUnitAction eAction, bool bBlocking, int priority, const char* szText, const AISignalExtraData& data);
  66.  
  67.         ~CUnitAction();
  68.         void        Update();
  69.         void        BlockedBy(CUnitAction* blockedAction);
  70.         void        UnlockMyBlockedActions();
  71.         void        NotifyMyBlockingActions();
  72.         inline bool IsBlocked() const         { return !m_BlockingActions.empty(); };
  73.         inline void SetPriority(int priority) { m_Priority = priority; };
  74.         void        Serialize(TSerialize ser);
  75.  
  76.         EUnitAction       m_Action;
  77.         bool              m_BlockingPlan;
  78.         TActionList       m_BlockingActions;
  79.         TActionList       m_BlockedActions;
  80.         int               m_Priority;
  81.         Vec3              m_Point;
  82.         Vec3              m_Direction;
  83.         float             m_fDistance;
  84.         string            m_SignalText;
  85.         int               m_Tag;
  86.         AISignalExtraData m_SignalData;
  87. };
  88.  
  89. #endif // __UnitAction_H__
  90.  
downloadUnitAction.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