EffectsManager Class
Definition
Section titled “Definition”Effects manager for a text surface.
public class EffectsManagerInheritance object
Constructors
Section titled “Constructors”EffectsManager(ICellSurface)
Section titled “EffectsManager(ICellSurface)”Creates a new effects manager associated with a text surface.
public EffectsManager(ICellSurface surface)Parameters
Section titled “Parameters”surface ICellSurface
Text surface to manage.
Fields
Section titled “Fields”_effects
Section titled “_effects”A dictionary of effect data keyed by the effect.
protected Dictionary<ICellEffect, EffectsManager.ColoredGlyphEffectData> _effects_effectCells
Section titled “_effectCells”A dictionary of effect data keyed by the cell index.
protected Dictionary<ColoredGlyphBase, EffectsManager.ColoredGlyphEffectData> _effectCells_backingSurface
Section titled “_backingSurface”The surface hosting this effects manager.
protected ICellSurface _backingSurfaceProperties
Section titled “Properties”Gets the number of effects.
public int Count { get; }Methods
Section titled “Methods”SetEffect(ColoredGlyphBase, ICellEffect?)
Section titled “SetEffect(ColoredGlyphBase, ICellEffect?)”Associates a cell effect with a cell.
public void SetEffect(ColoredGlyphBase cell, ICellEffect? effect)Parameters
Section titled “Parameters”cell ColoredGlyphBase
Cell to set the effect for.
effect ICellEffect
The effect to associate with the cell.
SetEffect(IEnumerable<ColoredGlyphBase>, ICellEffect?)
Section titled “SetEffect(IEnumerable<ColoredGlyphBase>, ICellEffect?)”Changes the effect of the cells provided.
public void SetEffect(IEnumerable<ColoredGlyphBase> cells, ICellEffect? effect)Parameters
Section titled “Parameters”cells IEnumerable<ColoredGlyphBase>
A list of cell indicies to change the effect on.
effect ICellEffect
The effect to associate with the cell.
GetEffect(ColoredGlyphBase)
Section titled “GetEffect(ColoredGlyphBase)”Gets the effect of the specified cell.
public ICellEffect? GetEffect(ColoredGlyphBase cell)Parameters
Section titled “Parameters”cell ColoredGlyphBase
Returns
Section titled “Returns”ICellEffect
The effect.
GetEffects()
Section titled “GetEffects()”Gets a collection of effects associated with the manager.
public IEnumerable<ICellEffect>? GetEffects()Returns
Section titled “Returns”IEnumerable<ICellEffect>
Null if there aren’t any effects.
DropInvalidCells()
Section titled “DropInvalidCells()”Checks all the cells in this manager and removes any that are no longer in the parent surface.
public void DropInvalidCells()Remove(ICellEffect)
Section titled “Remove(ICellEffect)”Removes an effect and associated cells from the manager.
public void Remove(ICellEffect effect)Parameters
Section titled “Parameters”effect ICellEffect
Effect to remove.
RemoveAll()
Section titled “RemoveAll()”Removes all effects and associated cells.
public void RemoveAll()GetKnownEffect(ICellEffect, out ColoredGlyphEffectData)
Section titled “GetKnownEffect(ICellEffect, out ColoredGlyphEffectData)”Gets effect data from the dictionary if it exists.
protected bool GetKnownEffect(ICellEffect effect, out EffectsManager.ColoredGlyphEffectData effectData)Parameters
Section titled “Parameters”effect ICellEffect
The effect to get.
effectData EffectsManager.ColoredGlyphEffectData
The effect data ssociated with the effect.
Returns
Section titled “Returns”bool
true when the effect exists; otherwise false.
ClearCellEffect(ColoredGlyphBase)
Section titled “ClearCellEffect(ColoredGlyphBase)”Clears the effect for the cell specified by index.
protected void ClearCellEffect(ColoredGlyphBase cell)Parameters
Section titled “Parameters”cell ColoredGlyphBase
The cell index.
UpdateEffects(TimeSpan)
Section titled “UpdateEffects(TimeSpan)”Updates all known effects and applies them to their associated cells.
public void UpdateEffects(TimeSpan delta)Parameters
Section titled “Parameters”delta TimeSpan
The time elapased since the last update.