Simulator::cSpaceInventoryItem class

Represents an item of the space player inventory. This include space tools and cargo.

Base classes

class DefaultRefCounted
The default implementation of a reference counted class.
class App::IUnmanagedMessageListener
Same as App::IMessageListener, but this one does not use ref-counting.
class ISimulatorSerializable

Derived classes

class cAnimalCargoInfo
class cObjectInstanceInventoryItem
class cPlantCargoInfo
class cSpaceToolData

Public static variables

static const uint32_t TYPE

Public static functions

static auto CreateMultiDeliveryObject(cSpaceInventoryItemPtr& dst, const ResourceKey& itemID, uint32_t instanceID) -> void
Creates an inventory item for multi-delivery mission objects.
static auto CreateTradingObject(cSpaceInventoryItemPtr& dst, const ResourceKey& itemID, int itemCount, float itemCost) -> void
Creates a trading object, which is an inventory item from GroupIDs::SpaceTrading_.

Public functions

auto GetType() -> uint32_t virtual
auto SetItemID(const ResourceKey& key) -> void virtual
auto GetItemID() -> const ResourceKey& virtual
auto GetItemInstanceID() -> uint32_t virtual
auto IsCargoType() -> bool virtual
auto Duplicate() -> cSpaceInventoryItemPtr virtual
auto GetDescription() -> const char16_t* virtual
auto GetDetailDescription() -> const char16_t* virtual
auto GetImageID() -> ResourceKey virtual
auto GetImageColors(size_t& dstCount, Math::ColorRGB*& dst) -> bool virtual
Returns the colors that override the icon color states, therefore 8 colors.
auto GetPanelID() -> ResourceKey virtual
Returns the key of the panel the tool belongs to.
auto GetItemCount(size_t& dst) -> bool virtual
auto func40h() -> int virtual
auto IsAvailableInCurrentPlanet() -> bool virtual
Returns true if this item is available in the current planet.
auto func48h() -> bool virtual
auto ParseProp() -> void virtual
auto SetPropList(App::PropertyList* propList) -> void
Assigns and reads the property list for this item.
auto AddRef() -> int virtual
auto Release() -> int virtual

Public variables

size_t mItemCount
SpaceInventoryItemType mItemType
unsigned int mItemCost
bool mbIsUnique
uint32_t mPoliticalId
unsigned int mItemPosition
bool mbIsActive
cSpaceInventoryItemPtr mpCargoSlot
PropertyListPtr mpPropList
LocalizedString mDescription
LocalizedString mDetailDescription
ResourceKey mItemID
App::IMessageManager* mpMessageManager
App::IMessageListener* mpMessageListener
uint32_t* mpMessageIDs
size_t mNumMessageIDs
int field_78

Function documentation

static void Simulator::cSpaceInventoryItem::CreateMultiDeliveryObject(cSpaceInventoryItemPtr& dst, const ResourceKey& itemID, uint32_t instanceID)

Creates an inventory item for multi-delivery mission objects.

Parameters
dst
itemID
instanceID

It will read a .prop file with name instanceID in the folder multiDelivery_mision_objects~ (0x37D494E).

static void Simulator::cSpaceInventoryItem::CreateTradingObject(cSpaceInventoryItemPtr& dst, const ResourceKey& itemID, int itemCount, float itemCost)

Creates a trading object, which is an inventory item from GroupIDs::SpaceTrading_.

Parameters
dst out Pointer where the new object will be written.
itemID Key to the item configuration in GroupIDs::SpaceTrading_
itemCount Number of items to create
itemCost Cost of the object

bool Simulator::cSpaceInventoryItem::GetImageColors(size_t& dstCount, Math::ColorRGB*& dst) virtual

Returns the colors that override the icon color states, therefore 8 colors.

Parameters
dstCount
dst
Returns

Those colors are get from the "spaceToolImageColors" property.

ResourceKey Simulator::cSpaceInventoryItem::GetPanelID() virtual

Returns the key of the panel the tool belongs to.

If this item is of cargo type, it returns the cargo panel key. Otherwise, it returns the value of the "spaceToolPanelKey" property.

bool Simulator::cSpaceInventoryItem::IsAvailableInCurrentPlanet() virtual

Returns true if this item is available in the current planet.

For example, for animal cargo this is true if the animal species is present in the planet.

void Simulator::cSpaceInventoryItem::SetPropList(App::PropertyList* propList)

Assigns and reads the property list for this item.

Parameters
propList

Most are stored in spacetrading~.