Skip to content

Commit 8f5dfa3

Browse files
authored
Rename GroupIDs::SpaceTrading to avoid name collisions (#54)
1 parent 552571a commit 8f5dfa3

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Spore ModAPI/Spore/CommonIDs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ namespace GroupIDs
213213

214214
/// Where space tools .prop files are stored
215215
SpaceTools = 0x30608F0B,
216-
/// Where trading configuration of space items are stored
217-
SpaceTrading = 0x034D97FA,
216+
/// Where trading configuration of space items are stored. Check Simulator::cSpaceTrading
217+
SpaceTrading_ = 0x034D97FA,
218218

219219
TribalTools = 0xF37C24E6,
220220
TribePlans = 0x72D02C25,

Spore ModAPI/Spore/Simulator/SubSystem/SpaceTrading.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <EASTL\vector.h>
1010
#include <EASTL\fixed_vector.h>
1111

12+
// Check Simulator::cSpaceTrading
1213
#define SpaceTrading (*Simulator::cSpaceTrading::Get())
1314
#define cNPCStorePtr eastl::intrusive_ptr<Simulator::cNPCStore>
1415

@@ -35,6 +36,13 @@ namespace Simulator
3536
};
3637
ASSERT_SIZE(cNPCStore, 0xC0);
3738

39+
/// Singleton class for everything related to space stage trading, such as obtaining tradable items
40+
/// or generating NPC stores. This class manages the objects in the GroupIDs::SpaceTrading_ folder.
41+
/// Example usage:
42+
/// ```cpp
43+
/// // Get 3 red spice
44+
/// SpaceTrading.ObtainTradingObject({ id("spice1"), TypeIDs::prop, GroupIDs::SpaceTrading_ }, 3);
45+
/// ```
3846
class cSpaceTrading
3947
/* 00h */ : public cStrategy
4048
/* 1Ch */ , public App::IMessageListener
@@ -51,7 +59,7 @@ namespace Simulator
5159
static bool IsRare(const ResourceKey& key);
5260

5361
/// Gives the specified trading object to the player, adding it to its inventory.
54-
/// The key must be a `.prop` file in GroupIDs::SpaceTrading group.
62+
/// The key must be a `.prop` file in GroupIDs::SpaceTrading_ group.
5563
/// If the item is a rare, it will show an event log, give a badge if necessary, and emit the SimulatorMessages::kMsgSpaceRareFound message.
5664
/// @param key The key of the item
5765
/// @param amount Quantity to give

Spore ModAPI/Spore/Simulator/cPlanetRecord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ namespace Simulator
223223
/* 184h */ PlanetID mKey;
224224
/* 188h */ ResourceKey field_188;
225225
/* 194h */ TechLevel mTechLevel;
226-
/// ID of the spice file of this planet in GroupIDs::SpaceTrading; all zeros if it hasn't been assigned yet
226+
/// ID of the spice file of this planet in GroupIDs::SpaceTrading_; all zeros if it hasn't been assigned yet
227227
/* 198h */ ResourceKey mSpiceGen;
228228
/* 1A4h */ ResourceKey mGeneratedTerrainKey;
229229
};

0 commit comments

Comments
 (0)