repairbaygameobj.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/repairbaygameobj.h $*
  25. * *
  26. * $Author:: Byon_g $*
  27. * *
  28. * $Modtime:: 7/16/01 11:20a $*
  29. * *
  30. * $Revision:: 6 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __REPAIRBAYGAMEOBJ_H
  39. #define __REPAIRBAYGAMEOBJ_H
  40. #include "always.h"
  41. #include "building.h"
  42. ////////////////////////////////////////////////////////////////
  43. // Forward delcarations
  44. ////////////////////////////////////////////////////////////////
  45. class BaseControllerClass;
  46. class SimpleGameObj;
  47. ////////////////////////////////////////////////////////////////
  48. //
  49. // RepairBayGameObjDef
  50. //
  51. ////////////////////////////////////////////////////////////////
  52. class RepairBayGameObjDef : public BuildingGameObjDef
  53. {
  54. public:
  55. ////////////////////////////////////////////////////////////////
  56. // Friends
  57. ////////////////////////////////////////////////////////////////
  58. friend class RepairBayGameObj;
  59. ////////////////////////////////////////////////////////////////
  60. // Public constructors/destructors
  61. ////////////////////////////////////////////////////////////////
  62. RepairBayGameObjDef (void);
  63. ~RepairBayGameObjDef (void);
  64. ////////////////////////////////////////////////////////////////
  65. // Public methods
  66. ////////////////////////////////////////////////////////////////
  67. uint32 Get_Class_ID (void) const;
  68. PersistClass * Create (void) const;
  69. bool Save (ChunkSaveClass &csave);
  70. bool Load (ChunkLoadClass &cload);
  71. const PersistFactoryClass & Get_Factory (void) const;
  72. ////////////////////////////////////////////////////////////////
  73. // Editable support
  74. ////////////////////////////////////////////////////////////////
  75. DECLARE_EDITABLE (RepairBayGameObjDef, BuildingGameObjDef);
  76. protected:
  77. ////////////////////////////////////////////////////////////////
  78. // Protected methods
  79. ////////////////////////////////////////////////////////////////
  80. void Load_Variables (ChunkLoadClass &cload);
  81. ////////////////////////////////////////////////////////////////
  82. // Protected member data
  83. ////////////////////////////////////////////////////////////////
  84. float RepairPerSec;
  85. int RepairingStaticAnimDefID;
  86. };
  87. ////////////////////////////////////////////////////////////////
  88. //
  89. // RepairBayGameObj
  90. //
  91. ////////////////////////////////////////////////////////////////
  92. class RepairBayGameObj : public BuildingGameObj
  93. {
  94. public:
  95. ////////////////////////////////////////////////////////////////
  96. // Public constructors/destructors
  97. ////////////////////////////////////////////////////////////////
  98. RepairBayGameObj (void);
  99. ~RepairBayGameObj (void);
  100. ////////////////////////////////////////////////////////////////
  101. // Public methods
  102. ////////////////////////////////////////////////////////////////
  103. //
  104. // Definition support
  105. //
  106. virtual void Init( void );
  107. void Init (const RepairBayGameObjDef & definition);
  108. const RepairBayGameObjDef & Get_Definition (void) const;
  109. //
  110. // RTTI
  111. //
  112. RepairBayGameObj * As_RepairBayGameObj (void) { return this; }
  113. //
  114. // Persist support
  115. //
  116. bool Save (ChunkSaveClass &csave);
  117. bool Load (ChunkLoadClass &cload);
  118. const PersistFactoryClass & Get_Factory (void) const;
  119. //
  120. // From BuildingGameObj
  121. //
  122. void CnC_Initialize (BaseControllerClass *base);
  123. //
  124. // GameObj methods
  125. //
  126. void Think (void);
  127. //
  128. // Network support
  129. //
  130. void Export_Creation (BitStreamClass &packet);
  131. void Import_Creation (BitStreamClass &packet);
  132. private:
  133. ////////////////////////////////////////////////////////////////
  134. // Private methods
  135. ////////////////////////////////////////////////////////////////
  136. void Load_Variables (ChunkLoadClass &cload);
  137. bool Repair_Vehicle (void);
  138. void Play_Repairing_Animation (bool onoff);
  139. void Update_Repairing_Animations (void);
  140. void Emit_Welding_Arc (RenderObjClass *vehicle_model);
  141. ////////////////////////////////////////////////////////////////
  142. // Private constants
  143. ////////////////////////////////////////////////////////////////
  144. enum
  145. {
  146. ARC_OBJ_COUNT = 4,
  147. BONE_COUNT = 6
  148. };
  149. ////////////////////////////////////////////////////////////////
  150. // Private member data
  151. ////////////////////////////////////////////////////////////////
  152. float RepairTimer;
  153. OBBoxClass RepairZone;
  154. int RepairAnimationID;
  155. bool IsReparing;
  156. DynamicVectorClass<GameObjReference> VehicleList;
  157. StaticPhysClass * RepairMesh;
  158. SimpleGameObj * ArcObjects[ARC_OBJ_COUNT];
  159. float ArcLifeRemaining[ARC_OBJ_COUNT];
  160. Matrix3D EndTM;
  161. Matrix3D Bones[BONE_COUNT];
  162. static const char * BoneNames[BONE_COUNT];
  163. };
  164. #endif // __REPAIRBAYGAMEOBJ_H