Show / Hide Table of Contents

    Class Item

    Class that represents all items in the game.

    Inheritance
    System.Object
    Thing
    Item
    ContainerItem
    Implements
    IItem
    IThing
    ILocatable
    System.IEquatable<IThing>
    IContainedThing
    Inherited Members
    Thing.LocationChanged
    Thing.UniqueId
    Thing.ParentContainer
    Thing.Location
    Thing.TrackedEvents
    Thing.Conditions
    Thing.RaiseLocationChanged(Location)
    Thing.ToString()
    Thing.Equals(IThing)
    Thing.StartTrackingEvent(IEvent, String)
    Thing.StopTrackingEvent(IEvent, String)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Fibula.Items
    Assembly: Fibula.Items.dll
    Syntax
    public class Item : Thing, IItem, IThing, ILocatable, IEquatable<IThing>, IContainedThing

    Constructors

    | Improve this Doc View Source

    Item(IItemTypeEntity)

    Initializes a new instance of the Item class.

    Declaration
    public Item(IItemTypeEntity type)
    Parameters
    Type Name Description
    IItemTypeEntity type

    The type of this item.

    Properties

    | Improve this Doc View Source

    Amount

    Gets or sets the amount of this item.

    Declaration
    public byte Amount { get; set; }
    Property Value
    Type Description
    System.Byte
    | Improve this Doc View Source

    Attributes

    Gets the attributes of this item.

    Declaration
    public IDictionary<ItemAttribute, IConvertible> Attributes { get; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<ItemAttribute, System.IConvertible>
    | Improve this Doc View Source

    BlocksLay

    Gets a value indicating whether the item blocks laying anything on it.

    Declaration
    public bool BlocksLay { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    BlocksPass

    Gets a value indicating whether the item blocks walking on it.

    Declaration
    public bool BlocksPass { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    BlocksThrow

    Gets a value indicating whether the item blocks throwing through it.

    Declaration
    public bool BlocksThrow { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    CanBeDressed

    Gets a value indicating whether this item can be dressed.

    Declaration
    public bool CanBeDressed { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    CanBeMoved

    Gets a value indicating whether this item can be moved.

    Declaration
    public override bool CanBeMoved { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    Thing.CanBeMoved
    | Improve this Doc View Source

    CanBeRotated

    Gets a value indicating whether this item can be rotated.

    Declaration
    public bool CanBeRotated { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    CarryLocation

    Gets the location where this thing is being carried at, if any.

    Declaration
    public override Location? CarryLocation { get; }
    Property Value
    Type Description
    System.Nullable<Location>
    Overrides
    Thing.CarryLocation
    | Improve this Doc View Source

    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
    public ushort ChangeOnUseTo { get; }
    Property Value
    Type Description
    System.UInt16
    Exceptions
    Type Condition
    System.InvalidOperationException

    When there is no target to change to.

    | Improve this Doc View Source

    ChangesOnUse

    Gets a value indicating whether this item changes on use.

    Declaration
    public bool ChangesOnUse { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DressPosition

    Gets the position at which the item can be dressed.

    Declaration
    public Slot DressPosition { get; }
    Property Value
    Type Description
    Slot
    | Improve this Doc View Source

    ExpirationTarget

    Gets the Id of the item into which this will expire to, if it HasExpiration.

    Declaration
    public ushort ExpirationTarget { get; }
    Property Value
    Type Description
    System.UInt16
    Exceptions
    Type Condition
    System.InvalidOperationException

    When the item does not expire.

    | Improve this Doc View Source

    ExpirationTimeLeft

    Gets the time left before this item expires, if it HasExpiration.

    Declaration
    public TimeSpan ExpirationTimeLeft { get; }
    Property Value
    Type Description
    System.TimeSpan
    Exceptions
    Type Condition
    System.InvalidOperationException

    When the item does not expire.

    | Improve this Doc View Source

    HasCollision

    Gets a value indicating whether this item triggers a collision event.

    Declaration
    public bool HasCollision { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    HasExpiration

    Gets a value indicating whether this item expires.

    Declaration
    public bool HasExpiration { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    HasSeparation

    Gets a value indicating whether this item triggers a separation event.

    Declaration
    public bool HasSeparation { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsContainer

    Gets a value indicating whether this item is a container.

    Declaration
    public bool IsContainer { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsCumulative

    Gets a value indicating whether this item can be accumulated.

    Declaration
    public bool IsCumulative { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsGround

    Gets a value indicating whether this item is ground floor.

    Declaration
    public bool IsGround { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsGroundFix

    Gets a value indicating whether this item is a ground aesthetic fix.

    Declaration
    public bool IsGroundFix { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLiquidContainer

    Gets a value indicating whether this item is a liquid container.

    Declaration
    public bool IsLiquidContainer { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLiquidPool

    Gets a value indicating whether this item is a liquid pool.

    Declaration
    public bool IsLiquidPool { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsLiquidSource

    Gets a value indicating whether this item is a liquid source.

    Declaration
    public bool IsLiquidSource { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LiquidType

    Gets the type of liquid in this item, assuming it: IsLiquidPool, IsLiquidSource, or IsLiquidContainer.

    Declaration
    public LiquidType LiquidType { get; }
    Property Value
    Type Description
    LiquidType
    | Improve this Doc View Source

    MovementPenalty

    Gets the movement cost for walking over this item, assuming it IsGround.

    Declaration
    public byte MovementPenalty { get; }
    Property Value
    Type Description
    System.Byte
    | Improve this Doc View Source

    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
    public ushort RotateTo { get; }
    Property Value
    Type Description
    System.UInt16
    Exceptions
    Type Condition
    System.InvalidOperationException

    When there is no target to rotate to.

    | Improve this Doc View Source

    StaysOnBottom

    Gets a value indicating whether this item stays on the bottom of the stack.

    Declaration
    public bool StaysOnBottom { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    StaysOnTop

    Gets a value indicating whether this item stays on top of the stack.

    Declaration
    public bool StaysOnTop { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Type

    Gets a reference to this item's IItemTypeEntity.

    Declaration
    public IItemTypeEntity Type { get; }
    Property Value
    Type Description
    IItemTypeEntity
    | Improve this Doc View Source

    TypeId

    Gets the type id of this item.

    Declaration
    public override ushort TypeId { get; }
    Property Value
    Type Description
    System.UInt16
    Overrides
    Thing.TypeId

    Methods

    | Improve this Doc View Source

    DescribeForLogger()

    Provides a string describing the current thing for logging purposes.

    Declaration
    public override string DescribeForLogger()
    Returns
    Type Description
    System.String

    The string to log.

    Overrides
    Thing.DescribeForLogger()
    | Improve this Doc View Source

    IsPathBlocking(Byte)

    Determines if this item is blocks pathfinding.

    Declaration
    public 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.

    | Improve this Doc View Source

    Merge(IItem)

    Attempts to join an item to this item's content at the default index.

    Declaration
    public (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.

    | Improve this Doc View Source

    Split(IItemFactory, Byte)

    Attempts to split this item into two based on the amount provided.

    Declaration
    public (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.

    Implements

    IItem
    IThing
    ILocatable
    System.IEquatable<T>
    IContainedThing

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.