CostModifierUpgrade.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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: CostModifierUpgrade.h /////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Electronic Arts Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2002 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // created: Aug 2002
  34. //
  35. // Filename: CostModifierUpgrade.h
  36. //
  37. // author: Chris Huybregts
  38. //
  39. // purpose:
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. #pragma once
  44. #ifndef __COST_MODIFIER_UPGRADE_H_
  45. #define __COST_MODIFIER_UPGRADE_H_
  46. //-----------------------------------------------------------------------------
  47. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  48. //-----------------------------------------------------------------------------
  49. //-----------------------------------------------------------------------------
  50. // USER INCLUDES //////////////////////////////////////////////////////////////
  51. //-----------------------------------------------------------------------------
  52. #include "GameLogic/Module/UpgradeModule.h"
  53. #include "Common/KindOf.h"
  54. //-----------------------------------------------------------------------------
  55. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  56. //-----------------------------------------------------------------------------
  57. class Thing;
  58. class Player;
  59. //-----------------------------------------------------------------------------
  60. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  61. //-----------------------------------------------------------------------------
  62. //-----------------------------------------------------------------------------
  63. // INLINING ///////////////////////////////////////////////////////////////////
  64. //-----------------------------------------------------------------------------
  65. //-----------------------------------------------------------------------------
  66. // EXTERNALS //////////////////////////////////////////////////////////////////
  67. //-----------------------------------------------------------------------------
  68. // FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
  69. //-------------------------------------------------------------------------------------------------
  70. //-------------------------------------------------------------------------------------------------
  71. class CostModifierUpgradeModuleData : public UpgradeModuleData
  72. {
  73. public:
  74. CostModifierUpgradeModuleData( void );
  75. static void buildFieldParse(MultiIniFieldParse& p);
  76. Real m_percentage;
  77. KindOfMaskType m_kindOf;
  78. };
  79. //-------------------------------------------------------------------------------------------------
  80. /** The OCL upgrade module */
  81. //-------------------------------------------------------------------------------------------------
  82. class CostModifierUpgrade : public UpgradeModule
  83. {
  84. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( CostModifierUpgrade, "CostModifierUpgrade" )
  85. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( CostModifierUpgrade, CostModifierUpgradeModuleData );
  86. public:
  87. CostModifierUpgrade( Thing *thing, const ModuleData* moduleData );
  88. // virtual destructor prototype defined by MemoryPoolObject
  89. virtual void onDelete( void ); ///< we have some work to do when this module goes away
  90. virtual void onCapture( Player *oldOwner, Player *newOwner );
  91. protected:
  92. virtual void upgradeImplementation( void ); ///< Here's the actual work of Upgrading
  93. virtual Bool isSubObjectsUpgrade() { return false; }
  94. };
  95. #endif // __COST_MODIFIER_UPGRADE_H_