Item Instance & Entry

UCrimsonInventoryItemInstance is the runtime, replicated representation of a live item. FCrimsonInventoryEntry is the slot record that wraps an instance with placement payload.

Integer and float tag stacks on instances

cpp
// Authority-only mutations
Instance->AddStatTagStack(TAG_Item_Charges, 5);
Instance->RemoveStatTagStack(TAG_Item_Charges, 1);
Instance->AddFloatTagStack(TAG_Item_Quality, 0.85f);
// Read from anywhere
int32 Charges = Instance->GetStatTagStackCount(TAG_Item_Charges);
float Quality = Instance->GetFloatTagStackCount(TAG_Item_Quality);

FCrimsonInventoryEntry - the slot record

Each entry has a stable EntryId, an instance, a stack count, and layout-payload fields. Layout-payload fields are interpreted by the active layout; layouts that don't use them leave them at defaults.

cpp
USTRUCT(BlueprintType)
struct FCrimsonInventoryEntry : public FFastArraySerializerItem
{
int64 GetEntryId() const; // server-assigned, stable across delta reorders
int32 GetSlotIndex() const; // display-order index for flat/weight layouts
FIntPoint GetGridPosition() const; // top-left cell for grid layouts
ECrimsonItemRotation GetRotation() const;
int32 GetLayoutGroupId() const; // bag-of-bags / typed-tab
bool IsLocked() const; // sort / quick-loot / quick-sell skip locked
UCrimsonInventoryItemInstance* GetItemInstance() const;
int32 GetStackCount() const;
FCrimsonPlacementTarget GetPlacementTarget() const;
};
cpp
// Iterate all entries
for (const FCrimsonInventoryEntry& Entry : InventoryComponent->GetSlottedEntries())
{
int64 Id = Entry.GetEntryId();
if (Entry.IsLocked()) continue;
UCrimsonInventoryItemInstance* Inst = Entry.GetItemInstance();
// ...
}
// Lookups by EntryId or target
const FCrimsonInventoryEntry* Entry = InventoryComponent->FindEntryByEntryId(SomeId);
const FCrimsonInventoryEntry* Hit = InventoryComponent->FindEntryAtTarget(SomeTarget);