Class BehaviourRegistry<T>
- Namespace
- SurvivorsMaker.Simulation
- Assembly
- SurvivorsMaker.Simulation.dll
Behaviours by id. Ids are case-sensitive. Registering an id that exists replaces it, so a game can override a built-in. Ids keeps first-registration order for tools.
public sealed class BehaviourRegistry<T> where T : class
Type Parameters
T
- Inheritance
-
BehaviourRegistry<T>
- Inherited Members
Constructors
BehaviourRegistry()
public BehaviourRegistry()
Properties
Ids
public IReadOnlyList<string> Ids { get; }
Property Value
Methods
Contains(string)
public bool Contains(string id)
Parameters
idstring
Returns
Get(string)
Throws InvalidOperationException naming the id when it is not registered.
public T Get(string id)
Parameters
idstring
Returns
- T
Register(string, T)
public void Register(string id, T behaviour)
Parameters
idstringbehaviourT
TryGet(string, out T)
public bool TryGet(string id, out T behaviour)
Parameters
idstringbehaviourT