Class CreatureManager
Class that represents a creature manager.
Inheritance
System.Object
CreatureManager
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.Creatures
Assembly: Fibula.Creatures.dll
Syntax
public class CreatureManager : ICreatureManager, ICreatureFinder
Constructors
| Improve this Doc View SourceCreatureManager(ILogger)
Initializes a new instance of the CreatureManager class.
Declaration
public CreatureManager(ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
Serilog.ILogger | logger | A reference to the logger to use. |
Properties
| Improve this Doc View SourceLogger
Gets a reference to the logger.
Declaration
public ILogger Logger { get; }
Property Value
Type | Description |
---|---|
Serilog.ILogger |
PlayerCount
Gets the count of players registered in the manager.
Declaration
public int PlayerCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceFindAllCreatures()
Gets all creatures known to this manager.
Declaration
public IEnumerable<ICreature> FindAllCreatures()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ICreature> | A collection of creature instances. |
FindAllPlayers()
Gets all players known to this manager.
Declaration
public IEnumerable<IPlayer> FindAllPlayers()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPlayer> | A collection of creature instances. |
FindCreatureById(UInt32)
Looks for a single creature with the id.
Declaration
public ICreature FindCreatureById(uint creatureId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The creature id for which to look. |
Returns
Type | Description |
---|---|
ICreature | The creature instance, if found, and null otherwise. |
FindPlayerById(UInt32)
Looks for a single player with the id.
Declaration
public IPlayer FindPlayerById(uint playerId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | playerId | The player id for which to look. |
Returns
Type | Description |
---|---|
IPlayer | The player instance, if found, and null otherwise. |
RegisterCreature(ICreature)
Registers a new creature to the manager.
Declaration
public void RegisterCreature(ICreature creature)
Parameters
Type | Name | Description |
---|---|---|
ICreature | creature | The creature to register. |
UnregisterCreature(ICreature)
Unregisters a creature from the manager.
Declaration
public void UnregisterCreature(ICreature creature)
Parameters
Type | Name | Description |
---|---|---|
ICreature | creature | The creature to unregister. |