Inventory
Inventories exist for each avatar and contains a variety of items.
State
- Account Address: Addresses.Inventory
- State Address: Use the address of avatar as it is.
Get State:
cs
public Inventory? GetInventory(IWorld world, Address address)
{
IAccount account = world.GetAccount(Addresses.Inventory);
if (account is null)
{
return null;
}
IValue state = account.GetState(address);
return state switch
{
Bencodex.Types.List l => new Inventory(l),
_ => null,
};
}