|
32 | 32 | namespace Simulator |
33 | 33 | { |
34 | 34 | class cStarRecord; |
| 35 | + class cEmpire; |
35 | 36 |
|
36 | 37 | struct cWallData |
37 | 38 | { |
@@ -187,13 +188,17 @@ namespace Simulator |
187 | 188 | void SetGeneratedTerrainKey(const ResourceKey& key); |
188 | 189 | ResourceKey& GetGeneratedTerrainKey(); |
189 | 190 |
|
| 191 | + ResourceKey GetTerrainScriptSource(); |
| 192 | + |
| 193 | + /// Returns the key to the icon that is displayed in planet tooltip. |
| 194 | + /// This depends on tech level, and whether it has an adventure. |
| 195 | + const ResourceKey& GetTypeIconKey(); |
| 196 | + |
190 | 197 | /// Generates a `.prop` file ResourceKey that is currently unused in game packages, so that |
191 | 198 | /// the planet terrain can be saved there. |
192 | 199 | /// @returns |
193 | 200 | static ResourceKey GenerateTerrainKey(); |
194 | 201 |
|
195 | | - ResourceKey GetTerrainScriptSource() const; |
196 | | - |
197 | 202 | /// Returns the distance of the perihelion, which is the planet's closest point to the parent object |
198 | 203 | /// in its orbit (the parent object is either a sun, or another planet if this planet is a moon). |
199 | 204 | /// @param pRecord The planet |
@@ -234,6 +239,14 @@ namespace Simulator |
234 | 239 | float baseValue, float maxOutput, float extraFactor, bool isHomeWorld, |
235 | 240 | bool useSuperpowerMultiplier, bool useStorageMultiplier, float finalFactor, int numCities, bool limitOutput); |
236 | 241 |
|
| 242 | + /// Return true if the planet ahs any city controlled by the specified empire. |
| 243 | + /// If 'requireMoreThanOneTurret' is true, then it will only return true if the controlled city |
| 244 | + /// has more than one turret. |
| 245 | + /// @param planetRecord |
| 246 | + /// @param empire |
| 247 | + /// @param requireMoreThanOneTurret |
| 248 | + static bool HasControlledCity(cPlanetRecord* planetRecord, cEmpire* empire, bool requireMoreThanOneTurret = false); |
| 249 | + |
237 | 250 | public: |
238 | 251 | /* 18h */ eastl::string16 mName; |
239 | 252 | /// The type of the planet, which determines whether it is a gas giant, asteroid belt, or regular rocky planet. |
@@ -296,6 +309,8 @@ namespace Simulator |
296 | 309 | DeclareAddress(CalculateSpiceProduction); // 0xC6F920 0xC70760 |
297 | 310 | DeclareAddress(CalculateDeltaSpiceProduction); // 0xC71200 0xC720A0 |
298 | 311 | DeclareAddress(GetTerrainScriptSource); // 0xB8D690 0xB8DEB0 |
| 312 | + DeclareAddress(HasControlledCity); // 0xC6F4B0 0xC702F0 |
| 313 | + DeclareAddress(GetTypeIconKey); // 0xE2EBE0 0xE2EB70 |
299 | 314 | } |
300 | 315 |
|
301 | 316 | inline ResourceKey cPlanetRecord::GenerateTerrainKey() |
|
0 commit comments