SpawnPointNode.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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/SpawnPointNode.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 2/23/01 9:58a $*
  29. * *
  30. * $Revision:: 3 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __SPAWN_POINT_NODE_H
  39. #define __SPAWN_POINT_NODE_H
  40. #include "node.h"
  41. #include "vector.h"
  42. #include "icons.h"
  43. #include "decophys.h"
  44. #include "spawnernode.h"
  45. ////////////////////////////////////////////////////////////////////////////
  46. // Forward declarations
  47. ////////////////////////////////////////////////////////////////////////////
  48. class PresetClass;
  49. ////////////////////////////////////////////////////////////////////////////
  50. //
  51. // SpawnPointNodeClass
  52. //
  53. ////////////////////////////////////////////////////////////////////////////
  54. class SpawnPointNodeClass : public NodeClass
  55. {
  56. public:
  57. //////////////////////////////////////////////////////////////////
  58. // Public constructors/destructors
  59. //////////////////////////////////////////////////////////////////
  60. SpawnPointNodeClass (PresetClass *preset = NULL);
  61. SpawnPointNodeClass (const SpawnPointNodeClass &src);
  62. ~SpawnPointNodeClass (void);
  63. //////////////////////////////////////////////////////////////
  64. // Public operators
  65. //////////////////////////////////////////////////////////////
  66. const SpawnPointNodeClass &operator= (const SpawnPointNodeClass &src);
  67. //////////////////////////////////////////////////////////////////
  68. // Public methods
  69. //////////////////////////////////////////////////////////////////
  70. //
  71. // SpawnPointNodeClass specific
  72. //
  73. SpawnerNodeClass * Peek_Spawner (void) const { return SpawnerNode; }
  74. void Set_Spawner (SpawnerNodeClass *spot) { SpawnerNode = spot; }
  75. //
  76. // From PersistClass
  77. //
  78. virtual const PersistFactoryClass & Get_Factory (void) const;
  79. //
  80. // From NodeClass
  81. //
  82. void Initialize (void);
  83. NodeClass * Clone (void) { return new SpawnPointNodeClass (*this); }
  84. NODE_TYPE Get_Type (void) const { return NODE_TYPE_SPAWN_POINT; }
  85. int Get_Icon_Index (void) const { return VIS_ICON; }
  86. PhysClass * Peek_Physics_Obj (void) const { return PhysObj; }
  87. bool Is_Static (void) const { return false; }
  88. bool Can_Be_Rotated_Freely (void) const { return true; }
  89. void On_Delete (void);
  90. NodeClass * Get_Parent_Node (void) const { return SpawnerNode; }
  91. //
  92. // Notifications
  93. //
  94. void On_Rotate (void);
  95. void On_Translate (void);
  96. void On_Transform (void);
  97. //
  98. // Export methods
  99. //
  100. void Pre_Export (void);
  101. void Post_Export (void);
  102. // From PersistClass
  103. bool Save (ChunkSaveClass &csave);
  104. bool Load (ChunkLoadClass &cload);
  105. protected:
  106. //////////////////////////////////////////////////////////////////
  107. // Protected methods
  108. //////////////////////////////////////////////////////////////////
  109. bool Load_Variables (ChunkLoadClass &cload);
  110. //////////////////////////////////////////////////////////////////
  111. // Protected member data
  112. //////////////////////////////////////////////////////////////////
  113. DecorationPhysClass * PhysObj;
  114. SpawnerNodeClass * SpawnerNode;
  115. static PhysClass * _TheCollisionObj;
  116. static int _InstanceCount;
  117. };
  118. //////////////////////////////////////////////////////////////////
  119. // On_Rotate
  120. //////////////////////////////////////////////////////////////////
  121. inline void
  122. SpawnPointNodeClass::On_Rotate (void)
  123. {
  124. if (SpawnerNode != NULL) {
  125. SpawnerNode->Update_Lines ();
  126. }
  127. NodeClass::On_Rotate ();
  128. return ;
  129. }
  130. //////////////////////////////////////////////////////////////////
  131. // On_Translate
  132. //////////////////////////////////////////////////////////////////
  133. inline void
  134. SpawnPointNodeClass::On_Translate (void)
  135. {
  136. if (SpawnerNode != NULL) {
  137. SpawnerNode->Update_Lines ();
  138. }
  139. NodeClass::On_Translate ();
  140. return ;
  141. }
  142. //////////////////////////////////////////////////////////////////
  143. // On_Transform
  144. //////////////////////////////////////////////////////////////////
  145. inline void
  146. SpawnPointNodeClass::On_Transform (void)
  147. {
  148. if (SpawnerNode != NULL) {
  149. SpawnerNode->Update_Lines ();
  150. }
  151. NodeClass::On_Transform ();
  152. return ;
  153. }
  154. #endif //__SPAWN_POINT_NODE_H