// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus).
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
using Fungus.Utils;
namespace Fungus
{
///
/// Writer event signalling system.
/// You can use this to be notified about various events in the writing process.
///
public static class WriterSignals
{
#region Public members
///
/// TextTagToken signal. Sent for each unique token when writing text.
///
public static event TextTagTokenHandler OnTextTagToken;
public delegate void TextTagTokenHandler(Writer writer, TextTagToken token, int index, int maxIndex);
public static void DoTextTagToken(Writer writer, TextTagToken token, int index, int maxIndex) { if(OnTextTagToken != null) OnTextTagToken(writer, token, index, maxIndex); }
///
/// WriterState signal. Sent when the writer changes state.
///
public static event WriterStateHandler OnWriterState;
public delegate void WriterStateHandler(Writer writer, WriterState writerState);
public static void DoWriterState(Writer writer, WriterState writerState) { if (OnWriterState != null) OnWriterState(writer, writerState); }
///
/// WriterInput signal. Sent when the writer receives player input.
///
public static event WriterInputHandler OnWriterInput;
public delegate void WriterInputHandler(Writer writer);
public static void DoWriterInput(Writer writer) { if (OnWriterInput != null) OnWriterInput(writer); }
///
/// WriterGlyph signal. Sent when the writer writes out a glyph.
///
public delegate void WriterGlyphHandler(Writer writer);
public static event WriterGlyphHandler OnWriterGlyph;
public static void DoWriterGlyph(Writer writer) { if (OnWriterGlyph != null) OnWriterGlyph(writer); }
#endregion
}
}