Show / Hide Table of Contents

    Class Tile

    Class that represents a tile in the map.

    Inheritance
    System.Object
    Tile
    Implements
    ITile
    IThingContainer
    ILocatable
    Inherited Members
    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)
    System.Object.ToString()
    Namespace: Fibula.Map
    Assembly: Fibula.Map.dll
    Syntax
    public class Tile : ITile, IThingContainer, ILocatable

    Constructors

    | Improve this Doc View Source

    Tile(Location, IItem)

    Initializes a new instance of the Tile class.

    Declaration
    public Tile(Location location, IItem ground)
    Parameters
    Type Name Description
    Location location

    The location of this tile.

    IItem ground

    The ground item to initialize the tile with.

    Properties

    | Improve this Doc View Source

    BlocksLay

    Gets a value indicating whether items in this tile block laying.

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

    BlocksPass

    Gets a value indicating whether items in this tile block passing.

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

    BlocksThrow

    Gets a value indicating whether items in this tile block throwing.

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

    CarryLocation

    Gets the location where this entity is being carried at, which is null for tiles.

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

    Creatures

    Gets the tile's creature ids.

    Declaration
    public IEnumerable<ICreature> Creatures { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<ICreature>
    | Improve this Doc View Source

    Flags

    Gets the flags from this tile.

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

    Ground

    Gets the single ground item that a tile may have.

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

    LastModified

    Gets the last date and time that this tile was modified.

    Declaration
    public DateTimeOffset LastModified { get; }
    Property Value
    Type Description
    System.DateTimeOffset
    | Improve this Doc View Source

    LiquidPool

    Gets the single liquid pool item that a tile may have.

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

    Location

    Gets this tile's location.

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

    TopCreature

    Gets the creature that is on top based on the tile's stack order.

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

    TopItem

    Gets the item that is on top based on the tile's stack order.

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

    TopThing

    Gets the thing that is on top based on the tile's stack order. Prioritizes creatures, then items.

    Declaration
    public IThing TopThing { get; }
    Property Value
    Type Description
    IThing

    Methods

    | Improve this Doc View Source

    AddContent(IThingFactory, IThing, Byte)

    Attempts to add a IThing to this container.

    Declaration
    public (bool result, IThing remainder) AddContent(IThingFactory thingFactory, IThing thing, byte index = 255)
    Parameters
    Type Name Description
    IThingFactory thingFactory

    A reference to the factory of things to use.

    IThing thing

    The IThing to add to the container.

    System.Byte index

    Optional. The index at which to add the IThing. Defaults to byte.MaxValue, which instructs to add the IThing at any free index.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, IThing>

    A tuple with a value indicating whether the attempt was at least partially successful, and false otherwise. If the result was only partially successful, a remainder of the thing may be returned.

    | Improve this Doc View Source

    FindItemWithTypeId(UInt16)

    Attempts to find an item in the tile with the given type.

    Declaration
    public IItem FindItemWithTypeId(ushort typeId)
    Parameters
    Type Name Description
    System.UInt16 typeId

    The type to look for.

    Returns
    Type Description
    IItem

    The item with such id, null otherwise.

    | Improve this Doc View Source

    FindThingAtIndex(Byte)

    Attempts to find an IThing whitin this container.

    Declaration
    public IThing FindThingAtIndex(byte index)
    Parameters
    Type Name Description
    System.Byte index

    The index at which to look for the IThing.

    Returns
    Type Description
    IThing

    The IThing found at the index, if any was found.

    | Improve this Doc View Source

    GetItemsToDescribeByPriority(Int32)

    Attempts to get the tile's items to describe prioritized and ordered by their stack order.

    Declaration
    public (IEnumerable<IItem> fixedItems, IEnumerable<IItem> normalItems) GetItemsToDescribeByPriority(int maxItemsToGet = 9)
    Parameters
    Type Name Description
    System.Int32 maxItemsToGet

    The maximum number of items to include in the result.

    Returns
    Type Description
    System.ValueTuple<System.Collections.Generic.IEnumerable<IItem>, System.Collections.Generic.IEnumerable<IItem>>

    The items in the tile, split by those which are fixed and those considered normal.

    Remarks

    The algorithm prioritizes the returned items in the following order:

    1. Ground item.
    2. Ground border items.
    3. Liquid pool item.
    4. Stay-on-bottom items.
    5. Stay-on-top items.
    6. Normal items.
    | Improve this Doc View Source

    GetStackOrderOfThing(IThing)

    Attempts to get the position in the stack for the given IThing.

    Declaration
    public byte GetStackOrderOfThing(IThing thing)
    Parameters
    Type Name Description
    IThing thing

    The thing to find.

    Returns
    Type Description
    System.Byte

    The position in the stack for the IThing, or System.Byte.MaxValue if its not found.

    | Improve this Doc View Source

    IsPathBlocking(Byte)

    Determines if this tile is considered to be blocking the path.

    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

    RemoveContent(IThingFactory, ref IThing, Byte, Byte)

    Attempts to remove a specific thing from this container.

    Declaration
    public (bool result, IThing remainder) RemoveContent(IThingFactory thingFactory, ref IThing thing, byte index = 255, byte amount = 1)
    Parameters
    Type Name Description
    IThingFactory thingFactory

    A reference to the factory of things to use.

    IThing thing

    The IThing to remove from the container.

    System.Byte index

    Optional. The index from which to remove the IThing. Defaults to byte.MaxValue, which instructs to remove the IThing if found at any index.

    System.Byte amount

    Optional. The amount of the thing to remove.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, IThing>

    A tuple with a value indicating whether the attempt was at least partially successful, and false otherwise. If the result was only partially successful, a remainder of the thing may be returned.

    | Improve this Doc View Source

    ReplaceContent(IThingFactory, IThing, IThing, Byte, Byte)

    Attempts to replace a IThing from this container with another.

    Declaration
    public (bool result, IThing remainderToChange) ReplaceContent(IThingFactory thingFactory, IThing fromThing, IThing toThing, byte index = 255, byte amount = 1)
    Parameters
    Type Name Description
    IThingFactory thingFactory

    A reference to the factory of things to use.

    IThing fromThing

    The IThing to remove from the container.

    IThing toThing

    The IThing to add to the container.

    System.Byte index

    Optional. The index from which to replace the IThing. Defaults to byte.MaxValue, which instructs to replace the IThing if found at any index.

    System.Byte amount

    Optional. The amount of the fromThing to replace.

    Returns
    Type Description
    System.ValueTuple<System.Boolean, IThing>

    A tuple with a value indicating whether the attempt was at least partially successful, and false otherwise. If the result was only partially successful, a remainder of the thing may be returned.

    | Improve this Doc View Source

    SetFlag(TileFlag)

    Sets a flag on this tile.

    Declaration
    public void SetFlag(TileFlag flag)
    Parameters
    Type Name Description
    TileFlag flag

    The flag to set.

    Implements

    ITile
    IThingContainer
    ILocatable

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    ContainerExtensions.GetParentContainerHierarchy(IThingContainer, Boolean)
    • 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.