Table of Contents

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

int

ContainedItemIds

Gets or sets persisted contained item serial identifiers.

public List<Serial> ContainedItemIds { get; set; }

Property Value

List<Serial>

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

IReadOnlyDictionary<Serial, ItemReference>

ContainerPosition

Gets or sets item position inside the parent container.

public Point2D ContainerPosition { get; set; }

Property Value

Point2D

EquippedLayer

Gets or sets the equipped layer when the item is worn.

public ItemLayerType? EquippedLayer { get; set; }

Property Value

ItemLayerType?

EquippedMobileId

Gets or sets the mobile serial when the item is equipped.

public Serial EquippedMobileId { get; set; }

Property Value

Serial

GumpId

Gets the optional container gump identifier.

public int? GumpId { get; set; }

Property Value

int?

Hue

public int Hue { get; set; }

Property Value

int

Id

Gets the unique serial identifier.

public Serial Id { get; set; }

Property Value

Serial

IsContainer

public bool IsContainer { get; }

Property Value

bool

IsStackable

public bool IsStackable { get; set; }

Property Value

bool

ItemId

Gets the item graphic identifier.

public int ItemId { get; set; }

Property Value

int

Items

Gets container child items when this item acts as a container.

public IReadOnlyList<UOItemEntity> Items { get; }

Property Value

IReadOnlyList<UOItemEntity>

Location

Gets or sets the entity world location.

public Point3D Location { get; set; }

Property Value

Point3D

Name

public string? Name { get; set; }

Property Value

string

ParentContainerId

Gets or sets parent container serial when the item is inside a container.

public Serial ParentContainerId { get; set; }

Property Value

Serial

Rarity

public ItemRarity Rarity { get; set; }

Property Value

ItemRarity

Weight

public int Weight { get; set; }

Property Value

int

Methods

AddItem(IItemEntity, Point2D)

Adds an item to this item when it is a container.

public void AddItem(IItemEntity item, Point2D position)

Parameters

item IItemEntity
position Point2D

HydrateContainedItemsRuntime(IEnumerable<UOItemEntity>)

Hydrates runtime contained-item references and in-memory child list from resolved entities.

public void HydrateContainedItemsRuntime(IEnumerable<UOItemEntity> containedItems)

Parameters

containedItems IEnumerable<UOItemEntity>

Resolved contained items for this container.

RemoveItem(Serial)

Removes a contained item entry from this container.

public bool RemoveItem(Serial itemId)

Parameters

itemId Serial

Contained item serial identifier.

Returns

bool

true when removed; otherwise false.

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

item UOItemEntity

Contained item to update.

position Point2D

New container-local position.

Returns

bool

true when the item is contained and updated; otherwise false.