warfactorygameobj.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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/warfactorygameobj.h $Author:: Patrick $*
  25. * *
  26. * $Modtime:: 1/05/02 11:54a $*
  27. * *
  28. * $Revision:: 7 $*
  29. * *
  30. *---------------------------------------------------------------------------------------------*
  31. * Functions: *
  32. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  33. #if defined(_MSC_VER)
  34. #pragma once
  35. #endif
  36. #ifndef __WARFACTORYGAMEOBJ_H
  37. #define __WARFACTORYGAMEOBJ_H
  38. #include "always.h"
  39. #include "vehiclefactorygameobj.h"
  40. ////////////////////////////////////////////////////////////////
  41. // Forward delcarations
  42. ////////////////////////////////////////////////////////////////
  43. class BaseControllerClass;
  44. ////////////////////////////////////////////////////////////////
  45. //
  46. // WarFactoryGameObjDef
  47. //
  48. ////////////////////////////////////////////////////////////////
  49. class WarFactoryGameObjDef : public VehicleFactoryGameObjDef
  50. {
  51. public:
  52. ////////////////////////////////////////////////////////////////
  53. // Friends
  54. ////////////////////////////////////////////////////////////////
  55. friend class WarFactoryGameObj;
  56. ////////////////////////////////////////////////////////////////
  57. // Public constructors/destructors
  58. ////////////////////////////////////////////////////////////////
  59. WarFactoryGameObjDef (void);
  60. ~WarFactoryGameObjDef (void);
  61. ////////////////////////////////////////////////////////////////
  62. // Public methods
  63. ////////////////////////////////////////////////////////////////
  64. uint32 Get_Class_ID (void) const;
  65. PersistClass * Create (void) const;
  66. bool Save (ChunkSaveClass &csave);
  67. bool Load (ChunkLoadClass &cload);
  68. const PersistFactoryClass & Get_Factory (void) const;
  69. ////////////////////////////////////////////////////////////////
  70. // Editable support
  71. ////////////////////////////////////////////////////////////////
  72. DECLARE_EDITABLE (WarFactoryGameObjDef, VehicleFactoryGameObjDef);
  73. protected:
  74. ////////////////////////////////////////////////////////////////
  75. // Protected methods
  76. ////////////////////////////////////////////////////////////////
  77. void Load_Variables (ChunkLoadClass &cload);
  78. ////////////////////////////////////////////////////////////////
  79. // Protected member data
  80. ////////////////////////////////////////////////////////////////
  81. };
  82. ////////////////////////////////////////////////////////////////
  83. //
  84. // WarFactoryGameObj
  85. //
  86. ////////////////////////////////////////////////////////////////
  87. class WarFactoryGameObj : public VehicleFactoryGameObj
  88. {
  89. public:
  90. ////////////////////////////////////////////////////////////////
  91. // Public constructors/destructors
  92. ////////////////////////////////////////////////////////////////
  93. WarFactoryGameObj (void);
  94. ~WarFactoryGameObj (void);
  95. ////////////////////////////////////////////////////////////////
  96. // Public methods
  97. ////////////////////////////////////////////////////////////////
  98. //
  99. // Definition support
  100. //
  101. virtual void Init( void );
  102. void Init (const WarFactoryGameObjDef & definition);
  103. const WarFactoryGameObjDef & Get_Definition (void) const;
  104. //
  105. // RTTI
  106. //
  107. WarFactoryGameObj * As_WarFactoryGameObj (void) { return this; }
  108. //
  109. // Persist support
  110. //
  111. bool Save (ChunkSaveClass &csave);
  112. bool Load (ChunkLoadClass &cload);
  113. const PersistFactoryClass & Get_Factory (void) const;
  114. //
  115. // From BuildingGameObj
  116. //
  117. void CnC_Initialize (BaseControllerClass *base);
  118. //
  119. // GameObj methods
  120. //
  121. void Think (void);
  122. protected:
  123. ////////////////////////////////////////////////////////////////
  124. // Protected methods
  125. ////////////////////////////////////////////////////////////////
  126. void Load_Variables (ChunkLoadClass &cload);
  127. void Play_Creation_Animation (bool onoff);
  128. void Begin_Generation (void);
  129. ////////////////////////////////////////////////////////////////
  130. // Protected member data
  131. ////////////////////////////////////////////////////////////////
  132. int CreationAnimationID;
  133. float CreationFinishedTimer;
  134. };
  135. #endif // __WARFACTORYGAMEOBJ_H