harvester.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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 : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/harvester.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 11/29/01 11:03a $*
  29. * *
  30. * $Revision:: 5 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __HARVESTER_H
  39. #define __HARVESTER_H
  40. #include "gameobjobserver.h"
  41. #include "vector3.h"
  42. #include "obbox.h"
  43. #include "wwstring.h"
  44. ////////////////////////////////////////////////////////////////
  45. // Forward declarations
  46. ////////////////////////////////////////////////////////////////
  47. class RefineryGameObj;
  48. class VehicleGameObj;
  49. ////////////////////////////////////////////////////////////////
  50. //
  51. // HarvesterClass
  52. //
  53. ////////////////////////////////////////////////////////////////
  54. class HarvesterClass : public GameObjObserverClass
  55. {
  56. public:
  57. ////////////////////////////////////////////////////////////////////
  58. // Public constructors/destructors
  59. ////////////////////////////////////////////////////////////////////
  60. HarvesterClass (void);
  61. ~HarvesterClass (void);
  62. ////////////////////////////////////////////////////////////////////
  63. // Public methods
  64. ////////////////////////////////////////////////////////////////////
  65. //
  66. // Initialization
  67. //
  68. void Initialize (void);
  69. //
  70. // Timestep
  71. //
  72. void Think (void);
  73. //
  74. // Action control
  75. //
  76. void Go_Harvest (void);
  77. void Go_Unload_Tiberium (void);
  78. void Unload_Tiberium (void);
  79. void Harvest_Tiberium (void);
  80. void Stop (void);
  81. //
  82. // Accessors
  83. //
  84. void Set_Refinery (RefineryGameObj *refinery) { Refinery = refinery; }
  85. void Set_Dock_Location (const Vector3 &pos) { DockLocation = pos; }
  86. void Set_Dock_Entrance (const Vector3 &pos) { DockEntrance = pos; }
  87. void Set_Tiberium_Region (const OBBoxClass &box) { TiberiumRegion = box; }
  88. void Set_Harvest_Anim (const char *name) { HarvestAnimationName = name; }
  89. VehicleGameObj * Get_Vehicle (void) { return Vehicle; }
  90. //
  91. // From GameObjObeserverClass
  92. //
  93. const char * Get_Name (void) { return "HarvesterClass"; }
  94. void Action_Complete (GameObject *obj, int action_id, ActionCompleteReason complete_reason);
  95. void Animation_Complete (GameObject *obj, const char * animation_name);
  96. void Custom (GameObject *game_obj, int type, int param, GameObject *sender);
  97. void Attach (GameObject *game_obj);
  98. void Detach (GameObject *game_obj);
  99. //
  100. // Unused methods from the base class
  101. //
  102. void Killed (GameObject *, GameObject *) {}
  103. void Damaged (GameObject *, GameObject *, float amount);
  104. void Created (GameObject *) {}
  105. void Destroyed (GameObject *);
  106. void Sound_Heard (GameObject *, const CombatSound &) {}
  107. void Enemy_Seen (GameObject *, GameObject *) {}
  108. void Timer_Expired (GameObject *, int) {}
  109. void Poked (GameObject *, GameObject *) {}
  110. void Entered (GameObject *, GameObject *) {}
  111. void Exited (GameObject *, GameObject *) {}
  112. private:
  113. ////////////////////////////////////////////////////////////////////
  114. // Private constants
  115. ////////////////////////////////////////////////////////////////////
  116. typedef enum
  117. {
  118. STATE_UNINITIALIZED = 0,
  119. STATE_GOING_TO_HARVEST,
  120. STATE_HARVESTING,
  121. STATE_GOING_TO_UNLOAD,
  122. STATE_UNLOADING
  123. } HarvesterState;
  124. ////////////////////////////////////////////////////////////////////
  125. // Private methods
  126. ////////////////////////////////////////////////////////////////////
  127. void Play_Harvest_Animation (bool onoff);
  128. ////////////////////////////////////////////////////////////////////
  129. // Private member data
  130. ////////////////////////////////////////////////////////////////////
  131. RefineryGameObj * Refinery;
  132. Vector3 DockLocation;
  133. Vector3 DockEntrance;
  134. HarvesterState State;
  135. OBBoxClass TiberiumRegion;
  136. VehicleGameObj * Vehicle;
  137. StringClass HarvestAnimationName;
  138. float StateTimer;
  139. float HarvestTimer;
  140. bool IsHarvesting;
  141. };
  142. #endif //__HARVESTER_H