Table of Contents

Class InventoryAspect

Namespace
RisingV.Core.Aspects
Assembly
RisingV.Core.dll

Aspect of an entity that has an inventory.

public class InventoryAspect : EntityAspect, IAspect<Entity>, IAspect
Inheritance
BaseAspect<Entity>
InventoryAspect
Implements
IAspect<Entity>
Inherited Members
Extension Methods

Constructors

InventoryAspect(EntityAspect, bool)

Initializes a new instance of the EntityAspect class with another aspect.

public InventoryAspect(EntityAspect aspect, bool strict = true)

Parameters

aspect EntityAspect

The aspect to copy from.

strict bool

If true, the aspect will throw an exception if the entity is null.

Exceptions

ArgumentNullException

Thrown when the entity of the aspect is null.

InventoryAspect(Entity, bool)

Initializes a new instance of the EntityAspect class with the specified entity.

public InventoryAspect(Entity entity, bool strict = true)

Parameters

entity Entity

The entity to associate with this aspect.

strict bool

If true, the aspect will throw an exception if the entity is null.

Exceptions

ArgumentNullException

Thrown when the entity is null.

Properties

Items

Gets the inventory items of this entity.

public List<InventoryItemData> Items { get; }

Property Value

List<InventoryItemData>

Queries

public static InventoryQueries Queries { get; }

Property Value

InventoryQueries

Methods

CountItems(PrefabGUID?, bool)

Counts the number of items in the inventory, optionally filtering by a specific item GUID.

public int CountItems(PrefabGUID? itemGuid = null, bool includeStacks = true)

Parameters

itemGuid PrefabGUID?

The GUID of the item to filter by. If null, all items are counted.

includeStacks bool

If true, counts the total amount of items including stacks; if false, counts each item individually.

Returns

int

The total count of items in the inventory.

Is(Entity)

public static bool Is(Entity entity)

Parameters

entity Entity

Returns

bool

Qualifies(Entity)

Checks if the entity qualifies for this aspect.

public override bool Qualifies(Entity entity)

Parameters

entity Entity

Returns

bool

Returns true if the entity qualifies, otherwise false.