CoverAttackPointNode.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : LevelEdit *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/LevelEdit/CoverAttackPointNode.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 5/11/01 9:30a $*
  29. * *
  30. * $Revision:: 6 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __COVER_ATTACK_POINT_NODE_H
  39. #define __COVER_ATTACK_POINT_NODE_H
  40. #include "node.h"
  41. #include "vector.h"
  42. #include "icons.h"
  43. #include "decophys.h"
  44. #include "coverspotnode.h"
  45. ////////////////////////////////////////////////////////////////////////////
  46. // Forward declarations
  47. ////////////////////////////////////////////////////////////////////////////
  48. class PresetClass;
  49. class CoverSpotNode;
  50. ////////////////////////////////////////////////////////////////////////////
  51. //
  52. // CoverAttackPointNodeClass
  53. //
  54. ////////////////////////////////////////////////////////////////////////////
  55. class CoverAttackPointNodeClass : public NodeClass
  56. {
  57. public:
  58. //////////////////////////////////////////////////////////////////
  59. // Public constructors/destructors
  60. //////////////////////////////////////////////////////////////////
  61. CoverAttackPointNodeClass (PresetClass *preset = NULL);
  62. CoverAttackPointNodeClass (const CoverAttackPointNodeClass &src);
  63. ~CoverAttackPointNodeClass (void);
  64. //////////////////////////////////////////////////////////////
  65. // Public operators
  66. //////////////////////////////////////////////////////////////
  67. const CoverAttackPointNodeClass &operator= (const CoverAttackPointNodeClass &src);
  68. //////////////////////////////////////////////////////////////////
  69. // Public methods
  70. //////////////////////////////////////////////////////////////////
  71. //
  72. // CoverAttackPointNodeClass specific
  73. //
  74. CoverSpotNodeClass * Peek_Cover_Spot (void) const { return m_CoverSpot; }
  75. void Set_Cover_Spot (CoverSpotNodeClass *spot) { m_CoverSpot = spot; }
  76. //
  77. // From PersistClass
  78. //
  79. virtual const PersistFactoryClass & Get_Factory (void) const;
  80. //
  81. // From NodeClass
  82. //
  83. void Initialize (void);
  84. NodeClass * Clone (void) { return new CoverAttackPointNodeClass (*this); }
  85. NODE_TYPE Get_Type (void) const { return NODE_TYPE_COVER_ATTACK_POINT; }
  86. int Get_Icon_Index (void) const { return OBJECT_ICON; }
  87. PhysClass * Peek_Physics_Obj (void) const { return m_PhysObj; }
  88. PhysClass * Peek_Collision_Obj (void) const;
  89. bool Is_Static (void) const { return false; }
  90. bool Show_Settings_Dialog (void) { return true; }
  91. bool Can_Be_Rotated_Freely (void) const { return true; }
  92. void On_Delete (void);
  93. NodeClass * Get_Parent_Node (void) const { return m_CoverSpot; }
  94. //
  95. // Notifications
  96. //
  97. void On_Rotate (void);
  98. void On_Translate (void);
  99. void On_Transform (void);
  100. //
  101. // Export methods
  102. //
  103. void Pre_Export (void);
  104. void Post_Export (void);
  105. // From PersistClass
  106. bool Save (ChunkSaveClass &csave);
  107. bool Load (ChunkLoadClass &cload);
  108. protected:
  109. //////////////////////////////////////////////////////////////////
  110. // Protected methods
  111. //////////////////////////////////////////////////////////////////
  112. bool Load_Variables (ChunkLoadClass &cload);
  113. //////////////////////////////////////////////////////////////////
  114. // Protected member data
  115. //////////////////////////////////////////////////////////////////
  116. DecorationPhysClass * m_PhysObj;
  117. CoverSpotNodeClass * m_CoverSpot;
  118. static PhysClass * _TheCollisionObj;
  119. static int _InstanceCount;
  120. };
  121. //////////////////////////////////////////////////////////////////
  122. // On_Rotate
  123. //////////////////////////////////////////////////////////////////
  124. inline void
  125. CoverAttackPointNodeClass::On_Rotate (void)
  126. {
  127. if (m_CoverSpot != NULL) {
  128. m_CoverSpot->Update_Lines ();
  129. }
  130. NodeClass::On_Rotate ();
  131. return ;
  132. }
  133. //////////////////////////////////////////////////////////////////
  134. // On_Translate
  135. //////////////////////////////////////////////////////////////////
  136. inline void
  137. CoverAttackPointNodeClass::On_Translate (void)
  138. {
  139. if (m_CoverSpot != NULL) {
  140. m_CoverSpot->Update_Lines ();
  141. }
  142. NodeClass::On_Translate ();
  143. return ;
  144. }
  145. //////////////////////////////////////////////////////////////////
  146. // On_Transform
  147. //////////////////////////////////////////////////////////////////
  148. inline void
  149. CoverAttackPointNodeClass::On_Transform (void)
  150. {
  151. if (m_CoverSpot != NULL) {
  152. m_CoverSpot->Update_Lines ();
  153. }
  154. NodeClass::On_Transform ();
  155. return ;
  156. }
  157. #endif //__COVER_ATTACK_POINT_NODE_H