teampurchasesettings.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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/teampurchasesettings.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 10/23/01 3:15p $*
  29. * *
  30. * $Revision:: 2 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __TEAMPURCHASESETTINGS_H
  39. #define __TEAMPURCHASESETTINGS_H
  40. #include "translatedb.h"
  41. #include "wwstring.h"
  42. #include "definition.h"
  43. //////////////////////////////////////////////////////////////////////
  44. //
  45. // TeamPurchaseSettingsDefClass
  46. //
  47. //////////////////////////////////////////////////////////////////////
  48. class TeamPurchaseSettingsDefClass : public DefinitionClass
  49. {
  50. public:
  51. //////////////////////////////////////////////////////////////////////
  52. // Public constants
  53. //////////////////////////////////////////////////////////////////////
  54. typedef enum
  55. {
  56. TEAM_GDI = 0,
  57. TEAM_NOD,
  58. TEAM_COUNT
  59. } TEAM;
  60. //////////////////////////////////////////////////////////////////////
  61. // Public constructors/destructors
  62. //////////////////////////////////////////////////////////////////////
  63. TeamPurchaseSettingsDefClass (void);
  64. ~TeamPurchaseSettingsDefClass (void);
  65. //////////////////////////////////////////////////////////////////////
  66. // Public methods
  67. //////////////////////////////////////////////////////////////////////
  68. //
  69. // From DefinitionClass
  70. //
  71. virtual uint32 Get_Class_ID (void) const;
  72. virtual PersistClass * Create (void) const ;
  73. virtual bool Save (ChunkSaveClass &csave);
  74. virtual bool Load (ChunkLoadClass &cload);
  75. virtual const PersistFactoryClass & Get_Factory (void) const;
  76. //
  77. // Accessors
  78. //
  79. TEAM Get_Team (void) { return Team; }
  80. const WCHAR * Get_Enlisted_Name (int index);
  81. int Get_Enlisted_Definition (int index) { return DefinitionList[index]; }
  82. const StringClass & Get_Enlisted_Texture (int index) { return TextureList[index]; }
  83. const WCHAR * Get_Beacon_Name (void) { return TRANSLATE (BeaconNameID); }
  84. int Get_Beacon_Cost (void) { return BeaconCost; }
  85. int Get_Beacon_Definition (void) { return BeaconDefinitionID; }
  86. const StringClass & Get_Beacon_Texture (void) { return BeaconTextureName; }
  87. const WCHAR * Get_Supply_Name (void) { return TRANSLATE (SupplyNameID); }
  88. const StringClass & Get_Supply_Texture (void) { return SupplyTextureName; }
  89. //
  90. // Singleton access
  91. //
  92. static TeamPurchaseSettingsDefClass * Get_Definition (TEAM team);
  93. //
  94. // Editable support
  95. //
  96. DECLARE_EDITABLE (TeamPurchaseSettingsDefClass, DefinitionClass);
  97. protected:
  98. //////////////////////////////////////////////////////////////////////
  99. // Protected methods
  100. //////////////////////////////////////////////////////////////////////
  101. void Load_Variables (ChunkLoadClass &cload);
  102. //////////////////////////////////////////////////////////////////////
  103. // Protected constants
  104. //////////////////////////////////////////////////////////////////////
  105. enum
  106. {
  107. MAX_ENTRIES = 4
  108. };
  109. //////////////////////////////////////////////////////////////////////
  110. // Protected member data
  111. //////////////////////////////////////////////////////////////////////
  112. TEAM Team;
  113. //
  114. // Enlisted character settings
  115. //
  116. int DefinitionList[MAX_ENTRIES];
  117. int NameList[MAX_ENTRIES];
  118. StringClass TextureList[MAX_ENTRIES];
  119. //
  120. // Beacon settings
  121. //
  122. int BeaconCost;
  123. int BeaconDefinitionID;
  124. int BeaconNameID;
  125. StringClass BeaconTextureName;
  126. //
  127. // Supply settings
  128. //
  129. int SupplyNameID;
  130. StringClass SupplyTextureName;
  131. static TeamPurchaseSettingsDefClass * DefinitionArray[TEAM_COUNT];
  132. };
  133. #endif //__TEAMPURCHASESETTINGS_H