LocomotorSetUpgrade.cpp 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: LocomotorSetUpgrade.cpp /////////////////////////////////////////////////////////////////////////////
  24. // Author: Graham Smallwood, March 2002
  25. // Desc: UpgradeModule that sets a weapon set bit for the Best Fit weapon set chooser to discover
  26. ///////////////////////////////////////////////////////////////////////////////////////////////////
  27. // INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
  28. #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
  29. #include "Common/Xfer.h"
  30. #include "GameLogic/Object.h"
  31. #include "GameLogic/Module/LocomotorSetUpgrade.h"
  32. #include "GameLogic/Module/AIUpdate.h"
  33. //-------------------------------------------------------------------------------------------------
  34. //-------------------------------------------------------------------------------------------------
  35. LocomotorSetUpgrade::LocomotorSetUpgrade( Thing *thing, const ModuleData* moduleData ) : UpgradeModule( thing, moduleData )
  36. {
  37. }
  38. //-------------------------------------------------------------------------------------------------
  39. //-------------------------------------------------------------------------------------------------
  40. LocomotorSetUpgrade::~LocomotorSetUpgrade( void )
  41. {
  42. }
  43. //-------------------------------------------------------------------------------------------------
  44. //-------------------------------------------------------------------------------------------------
  45. void LocomotorSetUpgrade::upgradeImplementation( )
  46. {
  47. AIUpdateInterface* ai = getObject()->getAIUpdateInterface();
  48. if (ai)
  49. ai->setLocomotorUpgrade(true);
  50. }
  51. // ------------------------------------------------------------------------------------------------
  52. /** CRC */
  53. // ------------------------------------------------------------------------------------------------
  54. void LocomotorSetUpgrade::crc( Xfer *xfer )
  55. {
  56. // extend base class
  57. UpgradeModule::crc( xfer );
  58. } // end crc
  59. // ------------------------------------------------------------------------------------------------
  60. /** Xfer method
  61. * Version Info:
  62. * 1: Initial version */
  63. // ------------------------------------------------------------------------------------------------
  64. void LocomotorSetUpgrade::xfer( Xfer *xfer )
  65. {
  66. // version
  67. XferVersion currentVersion = 1;
  68. XferVersion version = currentVersion;
  69. xfer->xferVersion( &version, currentVersion );
  70. // extend base class
  71. UpgradeModule::xfer( xfer );
  72. } // end xfer
  73. // ------------------------------------------------------------------------------------------------
  74. /** Load post process */
  75. // ------------------------------------------------------------------------------------------------
  76. void LocomotorSetUpgrade::loadPostProcess( void )
  77. {
  78. // extend base class
  79. UpgradeModule::loadPostProcess();
  80. } // end loadPostProcess