GrantUpgradeCreate.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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: GrantUpgradeCreate.h //////////////////////////////////////////////////////////////////////////
  24. // Author: Kris Morness, April 2002
  25. // Desc: GrantUpgrade create module
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. #pragma once
  28. #ifndef __GRANTUPGRADECREATE_H_
  29. #define __GRANTUPGRADECREATE_H_
  30. #define DEFINE_OBJECT_STATUS_NAMES
  31. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  32. #include "GameLogic/Module/CreateModule.h"
  33. #include "GameLogic/Object.h"
  34. #include "Common/ObjectStatusTypes.h"
  35. // FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
  36. class Thing;
  37. //-------------------------------------------------------------------------------------------------
  38. /** The GrantUpgrade create module */
  39. //-------------------------------------------------------------------------------------------------
  40. class GrantUpgradeCreateModuleData : public CreateModuleData
  41. {
  42. public:
  43. AsciiString m_upgradeName; ///< name of the upgrade to be granted.
  44. ObjectStatusMaskType m_exemptStatus; ///< do not execute if this status is set in the object
  45. GrantUpgradeCreateModuleData();
  46. static void buildFieldParse(MultiIniFieldParse& p);
  47. };
  48. // ------------------------------------------------------------------------------------------------
  49. // ------------------------------------------------------------------------------------------------
  50. class GrantUpgradeCreate : public CreateModule
  51. {
  52. MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( GrantUpgradeCreate, "GrantUpgradeCreate" );
  53. MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( GrantUpgradeCreate, GrantUpgradeCreateModuleData );
  54. public:
  55. GrantUpgradeCreate( Thing *thing, const ModuleData* moduleData );
  56. // virtual destructor prototype provided by memory pool declaration
  57. /// the create method
  58. virtual void onCreate( void );
  59. virtual void onBuildComplete(); ///< This is called when you are a finished game object
  60. protected:
  61. };
  62. #endif // __GRANTUPGRADECREATE_H_