Struct Location
Structure for all locations in the game.
Inherited Members
Namespace: Fibula.Common.Contracts.Structs
Assembly: Fibula.Common.Contracts.dll
Syntax
public struct Location
Properties
| Improve this Doc View SourceContainerId
Gets the id of the container that's encoded in this location.
Declaration
public byte ContainerId { get; }
Property Value
Type | Description |
---|---|
System.Byte |
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 |
IsUnderground
Gets a value indicating whether this location is underground.
Declaration
public bool IsUnderground { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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 |
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 |
Slot
Gets the slot id encoded in this location.
Declaration
public Slot Slot { get; }
Property Value
Type | Description |
---|---|
Slot |
Type
Gets this location's type.
Declaration
public LocationType Type { get; }
Property Value
Type | Description |
---|---|
LocationType |
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 |
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 |
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 SourceDirectionTo(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 |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
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. |
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 |
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
Operators
| Improve this Doc View SourceAddition(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. |
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. |
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 |
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. |
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 |
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. |