Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: AI Utility classes for building the initial AI Networks
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef AI_INITUTILS_H
  8. #define AI_INITUTILS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "ai_basenpc.h"
  13. #include "ai_node.h"
  14. //###########################################################
  15. // >> HintNodeData
  16. //
  17. // This is a chunk of data that's passed to a hint node entity
  18. // when it's created from a CNodeEnt.
  19. //###########################################################
  20. enum HintIgnoreFacing_t
  21. {
  22. HIF_NO,
  23. HIF_YES,
  24. HIF_DEFAULT,
  25. };
  26. struct HintNodeData
  27. {
  28. string_t strEntityName;
  29. Vector vecPosition;
  30. short nHintType;
  31. int nNodeID;
  32. string_t strGroup;
  33. int iDisabled;
  34. string_t iszGenericType;
  35. string_t iszActivityName;
  36. int nTargetWCNodeID;
  37. HintIgnoreFacing_t fIgnoreFacing;
  38. NPC_STATE minState;
  39. NPC_STATE maxState;
  40. int nRadius;
  41. int nWCNodeID; // Node ID assigned by worldcraft (not same as engine!)
  42. DECLARE_SIMPLE_DATADESC();
  43. };
  44. //###########################################################
  45. // >> CNodeEnt
  46. //
  47. // This is the entity that is loaded in from worldcraft.
  48. // It is only used to build the network and is deleted
  49. // immediately
  50. //###########################################################
  51. class CNodeEnt : public CServerOnlyPointEntity
  52. {
  53. DECLARE_CLASS( CNodeEnt, CServerOnlyPointEntity );
  54. public:
  55. virtual void SetOwnerEntity( CBaseEntity* pOwner ) { BaseClass::SetOwnerEntity( NULL ); }
  56. static int m_nNodeCount;
  57. void Spawn( void );
  58. int Spawn( const char *pMapData );
  59. DECLARE_DATADESC();
  60. CNodeEnt(void);
  61. public:
  62. HintNodeData m_NodeData;
  63. };
  64. //###########################################################
  65. // >> CAI_TestHull
  66. //
  67. // a modelless clip hull that verifies reachable nodes by
  68. // walking from every node to each of it's connections//
  69. //###########################################################
  70. class CAI_TestHull : public CAI_BaseNPC
  71. {
  72. DECLARE_CLASS( CAI_TestHull, CAI_BaseNPC );
  73. private:
  74. static CAI_TestHull* pTestHull; // Hull for testing connectivity
  75. public:
  76. static CAI_TestHull* GetTestHull(void); // Get the test hull
  77. static void ReturnTestHull(void); // Return the test hull
  78. bool bInUse;
  79. virtual void Precache();
  80. void Spawn(void);
  81. virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~(FCAP_ACROSS_TRANSITION|FCAP_DONT_SAVE); }
  82. virtual bool IsJumpLegal(const Vector &startPos, const Vector &apex, const Vector &endPos) const;
  83. ~CAI_TestHull(void);
  84. };
  85. #endif // AI_INITUTILS_H