Skip to main content

C++ reference

The Core surface is frozen: additive changes are free, and anything that alters an existing signature, struct layout, enum order or replication format goes through a written change record first. The plugin's Docs/PublicAPI.md carries the freeze document and the record of every break.

Core — EDInventoryCore​

Items​

#include "ItemDefinition/EDItemDefinition.h"
#include "Item/EDItemEntry.h"
#include "Item/EDItemStatics.h"
TypeRole
UEDItemDefinitionThe immutable asset. Category, Tags, Fragments, InstanceClass, FindFragment<T>(), HasFragment<T>()
FEDItemEntryThe struct fast path: DefinitionId, Handle, StackCount, State, DynamicTags, SlotAddress, Instance
FEDItemRefHow everything else names an item — loot entries, vendor offers, crafting ingredients, prerequisites, initial items. Id, IsSet(), Resolve() (never loads). An item-definition picker in the editor
FEDItemHandleOpaque server-allocated identity. IsValid, NetSerialize, GetTypeHash
FEDItemStateContainerTag-keyed per-stack numbers
UEDItemInstanceOpt-in per-item UObject; PromoteEntry / DemoteEntry
UEDItemStaticsResolveDefinition, FindItemFragment<T>, GetItemDisplayName, GetItemFootprint, DoesItemCoverCell
EDStackOpsGetMaxStackSize, CanStackTogether, DrainByDefinition, AddByDefinition

Containers​

#include "Container/EDContainer.h"
#include "Container/EDContainerDefinition.h"
#include "Container/EDContainerComponent.h"

UEDContainer carries the action API — see Containers and layouts.

GroupMembers
IdentityGetContainerType, GetContainerId, GetOwningActor, HasAuthority, GetMaxSlots, IsUnlimited
ReadGetEntries, GetNumEntries, FindEntry, FindEntryByPredicate, GetEntryAtIndex, GetAllItems, ContainsHandle, ContainsDefinition, CountByDefinition, GetTotalItemCount, FindHandlesByDefinition
Act (authority)TryAddItem, TryRemoveItem, TryRemoveItems, TryTransferItem
Act (anywhere)RequestTransaction, RequestTransferItem, RequestSort, RequestMove, RequestSplit, RequestMerge, RequestSwap, RequestDestroy
CheckEvaluateAddItem, GetAcceptanceError, CanAcceptEntry, EvaluateRulesForCandidate
Rules / layoutGetRules, SetRules, FindRule<T>, HasRule<T>, GetLayoutConfig, SetLayoutConfig, ResolveLayout, ResolvePlacement, RepackEntries
Apply ops (transactions only)AddEntry, RemoveEntry, RemoveEntries, UpdateEntry, MoveEntry, SetEntrySlotAddress, SetEntryDynamicTags

UEDContainerDefinition — ContainerTag, DisplayName, Description, Icon, ContainerTags, ContainerClass, Layout, ItemQuery, Priority, Rules, ResolveSlotCount(Owner), AcceptsItemDefinition(Definition).

UEDContainerComponent — one actor, one container. Definition (a UEDContainerDefinition*, the whole configuration) plus GetContainer(), GetContainerType(), FindContainerByType, GetContainerComponents.

UEDInventoryRouteComponent (abstract) — RequestTransaction, OnTransactionResult, HasAuthority, static FindClientRoute. Both inventory components derive from it.

The inventory​

#include "EDInventoryManagerComponent.h"
#include "EDInventoryOwnerInterface.h"

UEDInventoryManagerComponent — see The inventory manager for the grouped list. IEDInventoryOwner has one function, GetInventoryManager.

Transactions​

#include "Transactions/EDCoreTransactions.h"
#include "Transactions/EDTransactionProcessor.h"
#include "EDInventorySubsystem.h"
TypeRole
FEDTransactionData-only base
EEDTransactionErrorReason enum — order frozen, it replicates
FEDTransactionResultbSuccess, Error, AffectedItems
FEDTransactionContextInstigator, bHasAuthority, HandleAllocator
IEDTransactionExecutorValidate / Execute / GetAffectedContainers
UEDTransactionProcessorRegistry + snapshot rollback
UEDInventorySubsystemExecuteTransaction, AllocateHandle, GetRollStream, SetRollSeed, Get(WorldContext)
FEDTransactionExecutorRegistryWhere a module contributes its own

Rules, layouts, observers​

#include "Rules/EDCoreRules.h"
#include "Layout/EDCoreLayouts.h"
#include "Container/EDContainerObserverComponent.h"

Rules: FEDContainerRule, FEDLockedRule, FEDForbiddenTagsRule, FEDAllowedTagsRule, FEDRuleContext, FEDRuleEvaluatorRegistry.

Layouts: FEDLayoutConfig, FEDListLayoutConfig, FEDSlotLayoutConfig, FEDGridLayoutConfig, IEDLayout, FEDLayoutRegistry, FEDSlotAddress.

Observers: UEDContainerObserverComponent — override CanObserve, ReevaluateItem, GetTrackedHandles, StopTrackingItem; you get GetSiblingContainers, FindHoldingContainer, RefreshBindings, RefreshAllItems, NotifyObservationContextChanged and teardown.

NotifyObservationContextChanged() is the one to call when something the observer gates CanObserve on has changed — most often that its actor now acts through a different pawn. An observer that could not observe drops what it was sent and remembers that it did, so this re-derives every held item rather than waiting for an inventory event a respawn never produces. See Keeping the inventory across a respawn.

Stranded items: UEDStrandedItemHandler, UEDStrandedItemHandler_Rehome.

Events and saving​

#include "Events/EDInventoryChange.h"
#include "Serialization/EDInventorySave.h"

FEDInventoryChange (ChangeType, Handle, Container), EEDInventoryChangeType, UEDInventoryMessageSubsystem for tag-routed global listeners, and EDInventorySave::SaveInventory / LoadInventory (whole inventory, nested containers included), SaveContainer / LoadContainer (one container), JSON export.

GAS bridge​

UEDGASLinkComponent, FEDGrantsFragment, FEDGrantCondition, FEDEffectGrant, FEDAbilityGrant, FEDAttributeSetGrant.

UEDGASLinkComponent::ResolveGrantSourceObject(const FEDItemEntry&) decides what a granted ability or effect calls its GAS source object — the item's UEDItemInstance by default, the component for a fast-path item that has none, or an object of your own if you override it. See What a granted ability can ask about its item.

Equipment — EDInventoryEquipment​

UEDEquipmentManagerComponent (Anchors, DefaultAttachRule, SetEquipmentState, GetEquipmentState, GetVisualMesh), FEDEquipmentSlotAnchor, FEDAttachRule and its three concrete rules with FEDAttachRuleRegistry, IEDEquipmentAvatar, FEDEquipmentFragment, FEDEquipmentState, UEDEquipmentStatics (MakeEquipmentLayout, GetEquipSlot, IsEquippable).

UI — EDInventoryUI​

UEDInventoryViewModel (SetSourceInventory, SetSource, Refresh, GetContainer, GetEntries, Request*, CycleSortMode), UEDInventoryViewBase, and the grid / list / bar / cell / slot / tooltip / context-menu widgets. UEDInventoryDragDropOp, EEDDropSemantic, UEDUIStatics.

Feature modules​

ModuleEntry points
WeightUEDWeightComponent, FEDWeightFragment, FEDWeightLimitRule, UEDWeightStatics
DurabilityFEDDurabilityFragment, UEDDurabilityStatics
CraftingUEDCraftingRecipe (EEDCraftingKind, Pattern), UEDCookingRecipe, UEDCraftingStatics (CanCraft, RequestCraft, MatchGrid, FindGridRecipe, RequestCraftFromGrid, GetGridSize, GetFuelSeconds), UEDProcessingComponent, FEDFuelFragment, and the craft / shaped-craft / cook / consume-fuel transactions
TradingUEDVendorComponent, FEDVendorOffer, FEDValueFragment, purchase/sale transactions
LootUEDLootTableAsset, UEDLootStatics, FEDLootRollResult
UsableFEDUsableFragment, UEDUsableStatics, UEDUsableSubsystem, FEDItemUsedEvent
Equipment · MutableUEDMutableEquipmentComponent, FEDMutableEquipmentFragment

Spatial (UEDSpatialStatics, FEDRotateTransaction) is in Core under Spatial/. There is no networking policy module: relevancy and dormancy belong to your actors, and container changes wake a dormant owner on their own.

Conventions​

  • Everything is prefixed ED. UED… for objects, FED… for structs, EED… for enums, IED… for interfaces.
  • Plugin modules use Public/ + Private/.
  • Fragments, rules, transactions and layout configs are data only — no virtuals. A vtable in an FInstancedStruct corrupts serialization.
  • Every file carries the copyright header.

Where next​