Class UOItemEntity
- Namespace
- Moongate.UO.Data.Persistence.Entities
- Assembly
- Moongate.UO.Data.dll
Minimal item entity implementation used by map and container systems.
public class UOItemEntity : IItemEntity, IPositionEntity, IUOEntity
- Inheritance
-
UOItemEntity
- Implements
- Inherited Members
Properties
Amount
public int Amount { get; set; }
Property Value
ContainedItemIds
Gets or sets persisted contained item serial identifiers.
public List<Serial> ContainedItemIds { get; set; }
Property Value
ContainedItemReferences
Gets runtime contained-item snapshots keyed by child serial. This cache is not used for persistence.
public IReadOnlyDictionary<Serial, ItemReference> ContainedItemReferences { get; }
Property Value
ContainerPosition
Gets or sets item position inside the parent container.
public Point2D ContainerPosition { get; set; }
Property Value
EquippedLayer
Gets or sets the equipped layer when the item is worn.
public ItemLayerType? EquippedLayer { get; set; }
Property Value
EquippedMobileId
Gets or sets the mobile serial when the item is equipped.
public Serial EquippedMobileId { get; set; }
Property Value
GumpId
Gets the optional container gump identifier.
public int? GumpId { get; set; }
Property Value
- int?
Hue
public int Hue { get; set; }
Property Value
Id
Gets the unique serial identifier.
public Serial Id { get; set; }
Property Value
IsContainer
public bool IsContainer { get; }
Property Value
IsStackable
public bool IsStackable { get; set; }
Property Value
ItemId
Gets the item graphic identifier.
public int ItemId { get; set; }
Property Value
Items
Gets container child items when this item acts as a container.
public IReadOnlyList<UOItemEntity> Items { get; }
Property Value
Location
Gets or sets the entity world location.
public Point3D Location { get; set; }
Property Value
Name
public string? Name { get; set; }
Property Value
ParentContainerId
Gets or sets parent container serial when the item is inside a container.
public Serial ParentContainerId { get; set; }
Property Value
Rarity
public ItemRarity Rarity { get; set; }
Property Value
Weight
public int Weight { get; set; }
Property Value
Methods
AddItem(IItemEntity, Point2D)
Adds an item to this item when it is a container.
public void AddItem(IItemEntity item, Point2D position)
Parameters
itemIItemEntitypositionPoint2D
HydrateContainedItemsRuntime(IEnumerable<UOItemEntity>)
Hydrates runtime contained-item references and in-memory child list from resolved entities.
public void HydrateContainedItemsRuntime(IEnumerable<UOItemEntity> containedItems)
Parameters
containedItemsIEnumerable<UOItemEntity>Resolved contained items for this container.
RemoveItem(Serial)
Removes a contained item entry from this container.
public bool RemoveItem(Serial itemId)
Parameters
itemIdSerialContained item serial identifier.
Returns
- bool
truewhen removed; otherwisefalse.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
UpdateItemLocation(UOItemEntity, Point2D)
Updates the container-local position for an item contained in this container.
public bool UpdateItemLocation(UOItemEntity item, Point2D position)
Parameters
itemUOItemEntityContained item to update.
positionPoint2DNew container-local position.
Returns
- bool
truewhen the item is contained and updated; otherwisefalse.