Class ContainerManager
Class that represents a manager for all item container operations by creatures.
Inheritance
Implements
Inherited Members
Namespace: Fibula.Mechanics
Assembly: Fibula.Mechanics.dll
Syntax
public class ContainerManager : IContainerManager
Constructors
| Improve this Doc View SourceContainerManager(ILogger, ICreatureFinder, IScheduler)
Initializes a new instance of the ContainerManager class.
Declaration
public ContainerManager(ILogger logger, ICreatureFinder creatureFinder, IScheduler scheduler)
Parameters
Type | Name | Description |
---|---|---|
Serilog.ILogger | logger | A reference to the logger in use. |
ICreatureFinder | creatureFinder | A reference to the creature finder in use. |
IScheduler | scheduler | A reference to the scheduler in use. |
Methods
| Improve this Doc View SourceCloseContainer(UInt32, IContainerItem, Byte)
Performs a container close action for a player.
Declaration
public void CloseContainer(uint forCreatureId, IContainerItem container, byte atPosition)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | forCreatureId | The id of the creature for which the container is being closed. |
IContainerItem | container | The container being closed. |
System.Byte | atPosition | The position of the container being closed, as seen by the player. |
FindAllForCreature(UInt32)
Finds all the containers known by the specified creature.
Declaration
public IEnumerable<IContainerItem> FindAllForCreature(uint creatureId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The id of the creature. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IContainerItem> | A collection of containers that the creature knows. |
FindForCreature(UInt32, IContainerItem)
Finds the position of a specified container as seen by a specific creature.
Declaration
public byte FindForCreature(uint creatureId, IContainerItem container)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The id of the creature for which to find the container. |
IContainerItem | container | The container to look for. |
Returns
Type | Description |
---|---|
System.Byte | The position of container found, or UnsetContainerPosition> if not found. |
FindForCreature(UInt32, Byte)
Finds a container for a specific creature at the specified position.
Declaration
public IContainerItem FindForCreature(uint creatureId, byte atPosition)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The id of the creature for which to find the container. |
System.Byte | atPosition | The position at which to look for the container. |
Returns
Type | Description |
---|---|
IContainerItem | The container found, or null if not found. |
OpenContainer(UInt32, IContainerItem, Byte)
Performs a container open action for a player.
Declaration
public void OpenContainer(uint forCreatureId, IContainerItem container, byte atPosition)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | forCreatureId | The id of the creature for which the container is being opened. |
IContainerItem | container | The container to open. |
System.Byte | atPosition | The position in which to open the container, for the player. |