SpecialPowerUpdateModule.h 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: SpecialPowerUpdateModule.h /////////////////////////////////////////////////////////////////////////////////
  24. // Author: Kris Morness, July 2003
  25. // Desc: Originally lived in UpdateModule.h
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __SPECIAL_POWER_UPDATE_MODULE_H
  29. #define __SPECIAL_POWER_UPDATE_MODULE_H
  30. #include "Common/Module.h"
  31. #include "Common/GameType.h"
  32. //-------------------------------------------------------------------------------------------------
  33. class SpecialPowerUpdateInterface
  34. {
  35. public:
  36. virtual Bool doesSpecialPowerUpdatePassScienceTest() const = 0;
  37. virtual ScienceType getExtraRequiredScience() const = 0; //Does this object have more than one special power module with the same spTemplate?
  38. virtual Bool initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions ) = 0;
  39. virtual Bool isSpecialAbility() const = 0;
  40. virtual Bool isSpecialPower() const = 0;
  41. virtual Bool isActive() const = 0;
  42. virtual CommandOption getCommandOption() const = 0;
  43. virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const = 0; //Is it active now?
  44. virtual Bool doesSpecialPowerHaveOverridableDestination() const = 0; //Does it have it, even if it's not active?
  45. virtual void setSpecialPowerOverridableDestination( const Coord3D *loc ) = 0;
  46. virtual Bool isPowerCurrentlyInUse( const CommandButton *command = NULL ) const = 0;
  47. };
  48. //-------------------------------------------------------------------------------------------------
  49. class SpecialPowerUpdateModule : public UpdateModule, public SpecialPowerUpdateInterface
  50. {
  51. MEMORY_POOL_GLUE_ABC( SpecialPowerUpdateModule )
  52. MAKE_STANDARD_MODULE_MACRO_ABC( SpecialPowerUpdateModule )
  53. public:
  54. SpecialPowerUpdateModule( Thing *thing, const ModuleData* moduleData );
  55. // virtual destructor prototype defined by MemoryPoolObject
  56. //SpecialPowerUpdateInterface virtual implementations
  57. virtual Bool doesSpecialPowerUpdatePassScienceTest() const;
  58. virtual ScienceType getExtraRequiredScience() const { return SCIENCE_INVALID; } //Does this object have more than one special power module with the same spTemplate?
  59. //SpecialPowerUpdateInterface PURE virtual implementations
  60. virtual Bool initiateIntentToDoSpecialPower(const SpecialPowerTemplate *specialPowerTemplate, const Object *targetObj, const Coord3D *targetPos, const Waypoint *way, UnsignedInt commandOptions ) = 0;
  61. virtual Bool isSpecialAbility() const = 0;
  62. virtual Bool isSpecialPower() const = 0;
  63. virtual Bool isActive() const = 0;
  64. virtual CommandOption getCommandOption() const = 0;
  65. virtual Bool doesSpecialPowerHaveOverridableDestinationActive() const = 0; //Is it active now?
  66. virtual Bool doesSpecialPowerHaveOverridableDestination() const = 0; //Does it have it, even if it's not active?
  67. virtual void setSpecialPowerOverridableDestination( const Coord3D *loc ) = 0;
  68. virtual Bool isPowerCurrentlyInUse( const CommandButton *command = NULL ) const = 0;
  69. };
  70. #endif