Show / Hide Table of Contents

    Struct Location

    Structure for all locations in the game.

    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Fibula.Common.Contracts.Structs
    Assembly: Fibula.Common.Contracts.dll
    Syntax
    public struct Location

    Properties

    | Improve this Doc View Source

    ContainerId

    Gets the id of the container that's encoded in this location.

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

    ContainerIndex

    Gets or sets the index of the container that's encoded in this location.

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

    IsUnderground

    Gets a value indicating whether this location is underground.

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

    MaxValueIn2D

    Gets the maximum value from X or Y in this location's coordinates.

    Declaration
    public int MaxValueIn2D { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    MaxValueIn3D

    Gets the maximum value from X, Y, or Z in this location's coordinates.

    Declaration
    public int MaxValueIn3D { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Slot

    Gets the slot id encoded in this location.

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

    Type

    Gets this location's type.

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

    X

    Gets or sets the value of this location in the X coordinate.

    Declaration
    public int X { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Y

    Gets or sets the value of this location in the Y coordinate.

    Declaration
    public int Y { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Z

    Gets or sets the value of this location in the Z coordinate.

    Declaration
    public sbyte Z { get; set; }
    Property Value
    Type Description
    System.SByte

    Methods

    | Improve this Doc View Source

    DirectionTo(Location, Boolean)

    Computes the direction in which the target is, as seen from this location.

    Declaration
    public Direction DirectionTo(Location target, bool returnDiagonals = false)
    Parameters
    Type Name Description
    Location target

    The target location.

    System.Boolean returnDiagonals

    Optional. A value indicating whether to include diagonals as the potential answer to this query. Defaults to false.

    Returns
    Type Description
    Direction

    The direction in which target is with respect to this location.

    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc View Source

    GetOffsetBetween(Location, Location)

    Computes the offset from the origin to the target.

    Declaration
    public static (long XOffset, long YOffset, int ZOffset) GetOffsetBetween(Location origin, Location target)
    Parameters
    Type Name Description
    Location origin

    The origin location.

    Location target

    The target location.

    Returns
    Type Description
    System.ValueTuple<System.Int64, System.Int64, System.Int32>

    An ordered set, containing the offset bewteen locations.

    | Improve this Doc View Source

    LocationAt(Direction)

    Computes the Location that is in the targetDirection, as seen from this location.

    Declaration
    public Location LocationAt(Direction targetDirection)
    Parameters
    Type Name Description
    Direction targetDirection

    The target direction.

    Returns
    Type Description
    Location

    The Location which is in the targetDirection with respect to this location.

    | Improve this Doc View Source

    ToString()

    Gets this location's string representation: it's coordinates.

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

    This location's string representation.

    Overrides
    System.ValueType.ToString()

    Operators

    | Improve this Doc View Source

    Addition(Location, Location)

    Adds two Location values.

    Declaration
    public static Location operator +(Location location1, Location location2)
    Parameters
    Type Name Description
    Location location1

    The first location.

    Location location2

    The second location.

    Returns
    Type Description
    Location

    The result of the operation.

    | Improve this Doc View Source

    Equality(Location, Location)

    Checks if two Location values are considered equal.

    Declaration
    public static bool operator ==(Location location1, Location location2)
    Parameters
    Type Name Description
    Location location1

    The first location.

    Location location2

    The second location.

    Returns
    Type Description
    System.Boolean

    True if they are equal, false otherwise.

    | Improve this Doc View Source

    GreaterThan(Location, Location)

    Checks if a Location is considered greater than Location. A Location is considered 'greater' than another when any of it's coordinates is greater than those of the other Location.

    Declaration
    public static bool operator>(Location location1, Location location2)
    Parameters
    Type Name Description
    Location location1

    The first location.

    Location location2

    The second location.

    Returns
    Type Description
    System.Boolean

    True if location1 is considered greater than location2.

    | Improve this Doc View Source

    Inequality(Location, Location)

    Checks if two Location values are considered equal.

    Declaration
    public static bool operator !=(Location location1, Location location2)
    Parameters
    Type Name Description
    Location location1

    The first location.

    Location location2

    The second location.

    Returns
    Type Description
    System.Boolean

    True if they are not equal, false otherwise.

    | Improve this Doc View Source

    LessThan(Location, Location)

    Checks if a Location is considered lesser than Location. A Location is considered 'lesser' than another when any of it's coordinates is less than those of the other Location.

    Declaration
    public static bool operator <(Location location1, Location location2)
    Parameters
    Type Name Description
    Location location1

    The first location.

    Location location2

    The second location.

    Returns
    Type Description
    System.Boolean

    True if location1 is considered lesser than location2.

    | Improve this Doc View Source

    Subtraction(Location, Location)

    Subtracts two Location values.

    Declaration
    public static Location operator -(Location location1, Location location2)
    Parameters
    Type Name Description
    Location location1

    The first location.

    Location location2

    The second location.

    Returns
    Type Description
    Location

    The result of the operation.

    Extension Methods

    LocationExtensions.DecodeContainer(Location, IMap, IContainerManager, out Byte, ICreature)
    LocationExtensions.FindItemByTypeId(Location, IMap, IContainerManager, UInt16, ICreature)
    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.