Skip to content

EffectsManager Class

Effects manager for a text surface.

C#
public class EffectsManager

Inheritance object

Creates a new effects manager associated with a text surface.

C#
public EffectsManager(ICellSurface surface)

surface ICellSurface
Text surface to manage.

A dictionary of effect data keyed by the effect.

C#
protected Dictionary<ICellEffect, EffectsManager.ColoredGlyphEffectData> _effects

A dictionary of effect data keyed by the cell index.

C#
protected Dictionary<ColoredGlyphBase, EffectsManager.ColoredGlyphEffectData> _effectCells

The surface hosting this effects manager.

C#
protected ICellSurface _backingSurface

Gets the number of effects.

C#
public int Count { get; }

Associates a cell effect with a cell.

C#
public void SetEffect(ColoredGlyphBase cell, ICellEffect? effect)

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.

C#
public void SetEffect(IEnumerable<ColoredGlyphBase> cells, ICellEffect? effect)

cells IEnumerable<ColoredGlyphBase>
A list of cell indicies to change the effect on.

effect ICellEffect
The effect to associate with the cell.

Gets the effect of the specified cell.

C#
public ICellEffect? GetEffect(ColoredGlyphBase cell)

cell ColoredGlyphBase

ICellEffect
The effect.

Gets a collection of effects associated with the manager.

C#
public IEnumerable<ICellEffect>? GetEffects()

IEnumerable<ICellEffect>
Null if there aren’t any effects.

Checks all the cells in this manager and removes any that are no longer in the parent surface.

C#
public void DropInvalidCells()

Removes an effect and associated cells from the manager.

C#
public void Remove(ICellEffect effect)

effect ICellEffect
Effect to remove.

Removes all effects and associated cells.

C#
public void RemoveAll()

GetKnownEffect(ICellEffect, out ColoredGlyphEffectData)

Section titled “GetKnownEffect(ICellEffect, out ColoredGlyphEffectData)”

Gets effect data from the dictionary if it exists.

C#
protected bool GetKnownEffect(ICellEffect effect, out EffectsManager.ColoredGlyphEffectData effectData)

effect ICellEffect
The effect to get.

effectData EffectsManager.ColoredGlyphEffectData
The effect data ssociated with the effect.

bool
true when the effect exists; otherwise false.

Clears the effect for the cell specified by index.

C#
protected void ClearCellEffect(ColoredGlyphBase cell)

cell ColoredGlyphBase
The cell index.

Updates all known effects and applies them to their associated cells.

C#
public void UpdateEffects(TimeSpan delta)

delta TimeSpan
The time elapased since the last update.