Team Fortress 2 Source Code as on 22/4/2020
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.

105 lines
2.6 KiB

  1. //========= Copyright 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 iszActivityName;
  35. int nTargetWCNodeID;
  36. HintIgnoreFacing_t fIgnoreFacing;
  37. NPC_STATE minState;
  38. NPC_STATE maxState;
  39. int nWCNodeID; // Node ID assigned by worldcraft (not same as engine!)
  40. DECLARE_SIMPLE_DATADESC();
  41. };
  42. //###########################################################
  43. // >> CNodeEnt
  44. //
  45. // This is the entity that is loaded in from worldcraft.
  46. // It is only used to build the network and is deleted
  47. // immediately
  48. //###########################################################
  49. class CNodeEnt : public CServerOnlyPointEntity
  50. {
  51. DECLARE_CLASS( CNodeEnt, CServerOnlyPointEntity );
  52. public:
  53. virtual void SetOwnerEntity( CBaseEntity* pOwner ) { BaseClass::SetOwnerEntity( NULL ); }
  54. static int m_nNodeCount;
  55. void Spawn( void );
  56. int Spawn( const char *pMapData );
  57. DECLARE_DATADESC();
  58. CNodeEnt(void);
  59. public:
  60. HintNodeData m_NodeData;
  61. };
  62. //###########################################################
  63. // >> CAI_TestHull
  64. //
  65. // a modelless clip hull that verifies reachable nodes by
  66. // walking from every node to each of it's connections//
  67. //###########################################################
  68. class CAI_TestHull : public CAI_BaseNPC
  69. {
  70. DECLARE_CLASS( CAI_TestHull, CAI_BaseNPC );
  71. private:
  72. static CAI_TestHull* pTestHull; // Hull for testing connectivity
  73. public:
  74. static CAI_TestHull* GetTestHull(void); // Get the test hull
  75. static void ReturnTestHull(void); // Return the test hull
  76. bool bInUse;
  77. virtual void Precache();
  78. void Spawn(void);
  79. virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() & ~(FCAP_ACROSS_TRANSITION|FCAP_DONT_SAVE); }
  80. virtual bool IsJumpLegal(const Vector &startPos, const Vector &apex, const Vector &endPos) const;
  81. ~CAI_TestHull(void);
  82. };
  83. #endif // AI_INITUTILS_H