Class LocationExtensions
Helper class for extension methods of locations.
Inheritance
System.Object
LocationExtensions
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.Mechanics.Contracts.Extensions
Assembly: Fibula.Mechanics.Contracts.dll
Syntax
public static class LocationExtensions
Methods
| Improve this Doc View SourceDecodeContainer(Location, IMap, IContainerManager, out Byte, ICreature)
Gets a thing container from a location.
Declaration
public static IThingContainer DecodeContainer(this Location fromLocation, IMap map, IContainerManager containerManager, out byte index, ICreature carrierCreature = null)
Parameters
Type | Name | Description |
---|---|---|
Location | fromLocation | The location from which to decode the container information. |
IMap | map | A reference to the map. |
IContainerManager | containerManager | A reference to the container manager. |
System.Byte | index | The index within the cyclinder to target. |
ICreature | carrierCreature | The creature that carries the decoded container. Required for locations of type InsideContainer and InventorySlot. |
Returns
Type | Description |
---|---|
IThingContainer | An instance of the target IThingContainer of the location. |
FindItemByTypeId(Location, IMap, IContainerManager, UInt16, ICreature)
Attempts to find an item at the given location.
Declaration
public static IItem FindItemByTypeId(this Location atLocation, IMap map, IContainerManager containerManager, ushort typeId, ICreature creature = null)
Parameters
Type | Name | Description |
---|---|---|
Location | atLocation | The location at which to look for the item. |
IMap | map | A reference to the map. |
IContainerManager | containerManager | A reference to the container manager. |
System.UInt16 | typeId | The type id of the item to look for. |
ICreature | creature | Optional. The creature that the location's cyclinder targets, if any. |
Returns
Type | Description |
---|---|
IItem | An item instance, if found at the location. |