Skip to content

CellEffectBase Class

A base class for cell effects.

C#
[DataContract]
public abstract class CellEffectBase : ICellEffect

Inheritance object

Implements ICellEffect

Creates a new instance of the effect.

C#
protected CellEffectBase()

A flag to indidcate that the delay timer has finished.

C#
[DataMember]
protected bool _delayFinished

The total time elapsed while processing the effect.

C#
[DataMember]
protected TimeSpan _timeElapsed

True when the effect is finished.

C#
[DataMember]
public bool IsFinished { get; protected set; }

Flags this effect to be cloned when assigned to a cell instead of reused.

C#
[DataMember]
public bool CloneOnAdd { get; set; }

A delay applied to the effect only when it first runs or is restarted.

C#
[DataMember]
public TimeSpan StartDelay { get; set; }

When true, the effect should be disassociated with cells when it has finished processing.

C#
[DataMember]
public bool RemoveOnFinished { get; set; }

When true, indicates the EffectsManager should restore the cell to its original state.

C#
[DataMember]
public bool RestoreCellOnRemoved { get; set; }

When true, indicates that the EffectsManager should run one update frame on this effect when it’s first added to the manager.

C#
[DataMember]
public bool RunEffectOnApply { get; set; }

ApplyToCell(ColoredGlyphBase, ColoredGlyphBase)

Section titled “ApplyToCell(ColoredGlyphBase, ColoredGlyphBase)”

Applies the state of the effect to a cell.

C#
public abstract bool ApplyToCell(ColoredGlyphBase cell, ColoredGlyphBase originalState)

cell ColoredGlyphBase
The surface cell using this effect.

originalState ColoredGlyphBase
The state of the cell prior to the effect being applied.

bool
true when this method modified the cell; otherwise false.

Updates the state of the effect.

C#
public virtual void Update(TimeSpan delta)

delta TimeSpan
Time since the last call to this effect.

Restarts the cell effect.

C#
public virtual void Restart()

Returns a duplicate of this effect.

C#
public abstract ICellEffect Clone()

ICellEffect
A new copy of this effect.