Interface IModifierCache
A helper class that caches IModifiers for quick lookups.
Namespace: IdleKit.Gameplay
Assembly: cs.temp.dll.dll
Syntax
public interface IModifierCache
Methods
Clear()
Completely clears all registered IModifiers, IModifiables and lookups.
Declaration
void Clear()
GetModifiablesAffectedByModifier(IModifier)
Returns a collection of all IModifiable affected by the given IModifier.
Declaration
List<IModifiable> GetModifiablesAffectedByModifier(IModifier modifier)
Parameters
Type | Name | Description |
---|---|---|
IModifier | modifier | The IModifier that is affecting. |
Returns
Type | Description |
---|---|
List<IModifiable> |
GetModifiablesAffectedByModifier(IModifier, IModifierFormula)
Returns a collection of all IModifiable affected by the given IModifier
filtered by modifierFormula
.
Declaration
List<IModifiable> GetModifiablesAffectedByModifier(IModifier modifier, IModifierFormula modifierFormula)
Parameters
Type | Name | Description |
---|---|---|
IModifier | modifier | The IModifier that is affecting. |
IModifierFormula | modifierFormula | The IModifierFormula that is used to filter. |
Returns
Type | Description |
---|---|
List<IModifiable> |
GetModifiersAffectingModifiable(IModifiable)
Returns a collection of all IModifiers affecting a specific IModifiable.
Declaration
List<IModifier> GetModifiersAffectingModifiable(IModifiable modifiable)
Parameters
Type | Name | Description |
---|---|---|
IModifiable | modifiable | The IModifiable being affected. |
Returns
Type | Description |
---|---|
List<IModifier> |
GetModifiersAffectingModifiable(IModifiable, IModifierFormula)
Returns a collection of all IModifiers affecting the modifiable
filtered
by modifierFormula
Declaration
List<IModifier> GetModifiersAffectingModifiable(IModifiable modifiable, IModifierFormula modifierFormula)
Parameters
Type | Name | Description |
---|---|---|
IModifiable | modifiable | The IModifiable being affected. |
IModifierFormula | modifierFormula | The IModifierFormula that is used to filter. |
Returns
Type | Description |
---|---|
List<IModifier> |
RegisterModifiable(IModifiable)
Register a IModifiable so it can be looked up by the below methods.
Declaration
void RegisterModifiable(IModifiable modifiable)
Parameters
Type | Name | Description |
---|---|---|
IModifiable | modifiable | The IModifiable to register. |
RegisterModifier(IModifier)
Register a IModifier so it starts affecting IModifiables by appearing in the below methods.
Declaration
void RegisterModifier(IModifier modifier)
Parameters
Type | Name | Description |
---|---|---|
IModifier | modifier | The IModifier to register. |
RegisterModifierFormula(IModifierFormula)
Register a IModifierFormula so it can be looked up by the below methods.
Declaration
void RegisterModifierFormula(IModifierFormula modifierFormula)
Parameters
Type | Name | Description |
---|---|---|
IModifierFormula | modifierFormula | The IModifierFormula to register. |
UnregisterModifiable(IModifiable)
Removes a IModifiable from the lookups.
Declaration
void UnregisterModifiable(IModifiable modifiable)
Parameters
Type | Name | Description |
---|---|---|
IModifiable | modifiable | The IModifiable to unregister. |
UnregisterModifier(IModifier)
Removes a IModifier from the lookups so it stops affecting IModifiables.
Declaration
void UnregisterModifier(IModifier modifier)
Parameters
Type | Name | Description |
---|---|---|
IModifier | modifier | The IModifier to unregister. |
UnRegisterModifierFormula(IModifierFormula)
Removes a IModifierFormula from the lookups.
Declaration
void UnRegisterModifierFormula(IModifierFormula modifierFormula)
Parameters
Type | Name | Description |
---|---|---|
IModifierFormula | modifierFormula | The IModifierFormula to unregister. |