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.

105 lines
2.1 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #pragma once
  7. #pragma warning(push, 1)
  8. #pragma warning(disable:4701 4702 4530)
  9. #include <fstream>
  10. #pragma warning(pop)
  11. #include "fgdlib/WCKeyValues.h"
  12. #include "mathlib/vector.h"
  13. class BoundBox;
  14. class CMapEntity;
  15. class Path3D;
  16. class CMapPathNode
  17. {
  18. public:
  19. CMapPathNode();
  20. CMapPathNode(const CMapPathNode& src);
  21. char szName[128]; // if blank, use default
  22. Vector pos;
  23. DWORD dwID;
  24. BOOL bSelected;
  25. char szTargets[2][128]; // resolved when saving to map - not used otherwise
  26. int nTargets;
  27. // other values
  28. WCKeyValues kv;
  29. CMapPathNode& operator=(const CMapPathNode& src);
  30. };
  31. class CMapPath
  32. {
  33. friend Path3D;
  34. public:
  35. CMapPath();
  36. ~CMapPath();
  37. enum
  38. {
  39. ADD_START = 0xfffffff0L,
  40. ADD_END = 0xfffffff1L
  41. };
  42. DWORD AddNode(DWORD dwAfterID, const Vector &vecPos);
  43. void DeleteNode(DWORD dwID);
  44. void SetNodePosition(DWORD dwID, Vector& pt);
  45. CMapPathNode * NodeForID(DWORD dwID, int* piIndex = NULL);
  46. void GetNodeName(int iIndex, int iName, CString& str);
  47. // set name/class
  48. void SetName(LPCTSTR pszName) { strcpy(m_szName, pszName); }
  49. LPCTSTR GetName() { return m_szName; }
  50. void SetClass(LPCTSTR pszClass) { strcpy(m_szClass, pszClass); }
  51. LPCTSTR GetClass() { return m_szClass; }
  52. void EditInfo();
  53. // save/load to/from RMF:
  54. void SerializeRMF(std::fstream&, BOOL fIsStoring);
  55. // save to map: (no load!!)
  56. void SerializeMAP(std::fstream&, BOOL fIsStoring, BoundBox *pIntersecting = NULL);
  57. //void SaveVMF(CChunkFile *pFile, CSaveInfo *pSaveInfo);
  58. //void LoadVMF(CChunkFile *pFile);
  59. CMapEntity *CreateEntityForNode(DWORD dwNodeID);
  60. void CopyNodeFromEntity(DWORD dwNodeID, CMapEntity *pEntity);
  61. // directions
  62. enum
  63. {
  64. dirOneway,
  65. dirCircular,
  66. dirPingpong
  67. };
  68. int GetNodeCount() { return m_Nodes.Count(); }
  69. private:
  70. // nodes + number of:
  71. CUtlVector<CMapPathNode> m_Nodes;
  72. DWORD GetNewNodeID();
  73. // name:
  74. char m_szName[128];
  75. char m_szClass[128];
  76. int m_iDirection;
  77. };