Interface IItem
Interface for all items in the game.
Inherited Members
Namespace: Fibula.Items.Contracts.Abstractions
Assembly: Fibula.Items.Contracts.dll
Syntax
public interface IItem : IThing, ILocatable, IEquatable<IThing>, ICloneableThing<IThing>, IContainedThing
Properties
| Improve this Doc View SourceAmount
Gets or sets the amount of this item.
Declaration
byte Amount { get; set; }
Property Value
Type | Description |
---|---|
System.Byte |
Attributes
Gets the attributes of this item.
Declaration
IDictionary<ItemAttribute, IConvertible> Attributes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<ItemAttribute, System.IConvertible> |
BlocksLay
Gets a value indicating whether the item blocks laying anything on it.
Declaration
bool BlocksLay { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
BlocksPass
Gets a value indicating whether the item blocks walking on it.
Declaration
bool BlocksPass { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
BlocksThrow
Gets a value indicating whether the item blocks throwing through it.
Declaration
bool BlocksThrow { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanBeDressed
Gets a value indicating whether this item can be dressed.
Declaration
bool CanBeDressed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
CanBeRotated
Gets a value indicating whether this item can be rotated.
Declaration
bool CanBeRotated { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ChangeOnUseTo
Gets the Id of the item into which this will change upon use. Callers must check ChangesOnUse to verify this item does indeed have a target.
Declaration
ushort ChangeOnUseTo { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
ChangesOnUse
Gets a value indicating whether this item changes on use.
Declaration
bool ChangesOnUse { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
DressPosition
Gets the position at which the item can be dressed.
Declaration
Slot DressPosition { get; }
Property Value
Type | Description |
---|---|
Slot |
ExpirationTarget
Gets the Id of the item into which this will expire to, if it HasExpiration.
Declaration
ushort ExpirationTarget { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | When the item does not expire. |
ExpirationTimeLeft
Gets the time left before this item expires, if it HasExpiration.
Declaration
TimeSpan ExpirationTimeLeft { get; }
Property Value
Type | Description |
---|---|
System.TimeSpan |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | When the item does not expire. |
HasCollision
Gets a value indicating whether this item triggers a collision event.
Declaration
bool HasCollision { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
HasExpiration
Gets a value indicating whether this item expires.
Declaration
bool HasExpiration { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
HasSeparation
Gets a value indicating whether this item triggers a separation event.
Declaration
bool HasSeparation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsContainer
Gets a value indicating whether this item is a container.
Declaration
bool IsContainer { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsCumulative
Gets a value indicating whether this item can be accumulated.
Declaration
bool IsCumulative { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsGround
Gets a value indicating whether this item is ground floor.
Declaration
bool IsGround { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsGroundFix
Gets a value indicating whether this item is clipped to the ground.
Declaration
bool IsGroundFix { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsLiquidContainer
Gets a value indicating whether this item is a liquid container.
Declaration
bool IsLiquidContainer { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsLiquidPool
Gets a value indicating whether this item is a liquid pool.
Declaration
bool IsLiquidPool { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsLiquidSource
Gets a value indicating whether this item is a liquid source.
Declaration
bool IsLiquidSource { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
LiquidType
Gets the type of liquid in this item, assuming it: IsLiquidPool, IsLiquidSource, or IsLiquidContainer.
Declaration
LiquidType LiquidType { get; }
Property Value
Type | Description |
---|---|
LiquidType |
MovementPenalty
Gets the movement cost for walking over this item, assuming it IsGround.
Declaration
byte MovementPenalty { get; }
Property Value
Type | Description |
---|---|
System.Byte |
RotateTo
Gets the Id of the item into which this will rotate to. Callers must check CanBeRotated to verify this item does indeed have a target.
Declaration
ushort RotateTo { get; }
Property Value
Type | Description |
---|---|
System.UInt16 |
StaysOnBottom
Gets a value indicating whether this item stays on the bottom of the stack.
Declaration
bool StaysOnBottom { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
StaysOnTop
Gets a value indicating whether this item stays on top of the stack.
Declaration
bool StaysOnTop { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Type
Gets a reference to this item's IItemTypeEntity.
Declaration
IItemTypeEntity Type { get; }
Property Value
Type | Description |
---|---|
IItemTypeEntity |
Methods
| Improve this Doc View SourceIsPathBlocking(Byte)
Determines if this item is blocks pathfinding.
Declaration
bool IsPathBlocking(byte avoidTypes = 14)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | avoidTypes | The damage types to avoid when checking for path blocking. By default, all types are considered path blocking. |
Returns
Type | Description |
---|---|
System.Boolean | True if the tile is considered path blocking, false otherwise. |
Merge(IItem)
Attempts to join an item to this item's content at the default index.
Declaration
(bool success, IItem surplusItem) Merge(IItem otherItem)
Parameters
Type | Name | Description |
---|---|---|
IItem | otherItem | The item to join with. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, IItem> | True if the operation was successful, false otherwise. Along with any surplus of the item after merge. |
Split(IItemFactory, Byte)
Attempts to split this item into two based on the amount provided.
Declaration
(bool success, IItem itemProduced) Split(IItemFactory itemFactory, byte amount)
Parameters
Type | Name | Description |
---|---|---|
IItemFactory | itemFactory | A reference to the item factory in use. |
System.Byte | amount | The amount of the item to split. |
Returns
Type | Description |
---|---|
System.ValueTuple<System.Boolean, IItem> | True if the operation was successful, false otherwise, along with the item produced, if any. |