namespace FTRuntime.Yields {
public static class SwfWaitExtensions {
// ---------------------------------------------------------------------
//
// WaitFor[Event]
//
// ---------------------------------------------------------------------
/// Yield instruction for wait animation stop event
/// Yield instruction for wait animation stop event
/// The controller
public static SwfWaitStopPlaying WaitForStopPlaying(
this SwfClipController ctrl)
{
return new SwfWaitStopPlaying(ctrl);
}
/// Yield instruction for wait animation rewind event
/// Yield instruction for wait animation rewind event
/// The controller
public static SwfWaitRewindPlaying WaitForRewindPlaying(
this SwfClipController ctrl)
{
return new SwfWaitRewindPlaying(ctrl);
}
/// Yield instruction for wait animation stop or rewind event
/// Yield instruction for wait animation stop or rewind event
/// The controller
public static SwfWaitStopOrRewindPlaying WaitForStopOrRewindPlaying(
this SwfClipController ctrl)
{
return new SwfWaitStopOrRewindPlaying(ctrl);
}
/// Yield instruction for wait animation play event
/// Yield instruction for wait animation play event
/// The controller
public static SwfWaitPlayStopped WaitForPlayStopped(
this SwfClipController ctrl)
{
return new SwfWaitPlayStopped(ctrl);
}
// ---------------------------------------------------------------------
//
// PlayAndWait[Event]
//
// ---------------------------------------------------------------------
/// Play with specified rewind action
/// Yield instruction for wait animation stop event
/// The clip controller
/// If set to true rewind animation to begin frame
public static SwfWaitStopPlaying PlayAndWaitStop(
this SwfClipController ctrl, bool rewind)
{
ctrl.Play(rewind);
return WaitForStopPlaying(ctrl);
}
/// Changes the animation sequence and play controller with rewind
/// Yield instruction for wait animation stop event
/// The clip controller
/// The new sequence
public static SwfWaitStopPlaying PlayAndWaitStop(
this SwfClipController ctrl, string sequence)
{
ctrl.Play(sequence);
return WaitForStopPlaying(ctrl);
}
/// Play with specified rewind action
/// Yield instruction for wait animation rewind event
/// The clip controller
/// If set to true rewind animation to begin frame
public static SwfWaitRewindPlaying PlayAndWaitRewind(
this SwfClipController ctrl, bool rewind)
{
ctrl.Play(rewind);
return WaitForRewindPlaying(ctrl);
}
/// Changes the animation sequence and play controller with rewind
/// Yield instruction for wait animation rewind event
/// The clip controller
/// The new sequence
public static SwfWaitRewindPlaying PlayAndWaitRewind(
this SwfClipController ctrl, string sequence)
{
ctrl.Play(sequence);
return WaitForRewindPlaying(ctrl);
}
/// Play with specified rewind action
/// Yield instruction for wait animation stop or rewind event
/// The clip controller
/// If set to true rewind animation to begin frame
public static SwfWaitStopOrRewindPlaying PlayAndWaitStopOrRewind(
this SwfClipController ctrl, bool rewind)
{
ctrl.Play(rewind);
return WaitForStopOrRewindPlaying(ctrl);
}
/// Changes the animation sequence and play controller with rewind
/// Yield instruction for wait animation stop or rewind event
/// The clip controller
/// The new sequence
public static SwfWaitStopOrRewindPlaying PlayAndWaitStopOrRewind(
this SwfClipController ctrl, string sequence)
{
ctrl.Play(sequence);
return WaitForStopOrRewindPlaying(ctrl);
}
// ---------------------------------------------------------------------
//
// GotoAndPlayAndWait[Event]
//
// ---------------------------------------------------------------------
/// Changes the animation frame with plays it
/// Yield instruction for wait animation stop event
/// The clip controller
/// The new current frame
public static SwfWaitStopPlaying GotoAndPlayAndWaitStop(
this SwfClipController ctrl, int frame)
{
ctrl.GotoAndPlay(frame);
return WaitForStopPlaying(ctrl);
}
/// Changes the animation sequence and frame with plays it
/// Yield instruction for wait animation stop event
/// The clip controller
/// The new sequence
/// The new current frame
public static SwfWaitStopPlaying GotoAndPlayAndWaitStop(
this SwfClipController ctrl, string sequence, int frame)
{
ctrl.GotoAndPlay(sequence, frame);
return WaitForStopPlaying(ctrl);
}
/// Changes the animation frame with plays it
/// Yield instruction for wait animation rewind event
/// The clip controller
/// The new current frame
public static SwfWaitRewindPlaying GotoAndPlayAndWaitRewind(
this SwfClipController ctrl, int frame)
{
ctrl.GotoAndPlay(frame);
return WaitForRewindPlaying(ctrl);
}
/// Changes the animation sequence and frame with plays it
/// Yield instruction for wait animation rewind event
/// The clip controller
/// The new sequence
/// The new current frame
public static SwfWaitRewindPlaying GotoAndPlayAndWaitRewind(
this SwfClipController ctrl, string sequence, int frame)
{
ctrl.GotoAndPlay(sequence, frame);
return WaitForRewindPlaying(ctrl);
}
/// Changes the animation frame with plays it
/// Yield instruction for wait animation stop and rewind event
/// The clip controller
/// The new current frame
public static SwfWaitStopOrRewindPlaying GotoAndPlayAndWaitStopOrRewind(
this SwfClipController ctrl, int frame)
{
ctrl.GotoAndPlay(frame);
return WaitForStopOrRewindPlaying(ctrl);
}
/// Changes the animation sequence and frame with plays it
/// Yield instruction for wait animation stop and rewind event
/// The clip controller
/// The new sequence
/// The new current frame
public static SwfWaitStopOrRewindPlaying GotoAndPlayAndWaitStopOrRewind(
this SwfClipController ctrl, string sequence, int frame)
{
ctrl.GotoAndPlay(sequence, frame);
return WaitForStopOrRewindPlaying(ctrl);
}
// ---------------------------------------------------------------------
//
// StopAndWait[Event]
//
// ---------------------------------------------------------------------
/// Stop with specified rewind action
/// Yield instruction for wait animation play event
/// The clip controller
/// If set to true rewind animation to begin frame
public static SwfWaitPlayStopped StopAndWaitPlay(
this SwfClipController ctrl, bool rewind)
{
ctrl.Stop(rewind);
return WaitForPlayStopped(ctrl);
}
/// Changes the animation sequence and stop controller with rewind
/// Yield instruction for wait animation play event
/// The clip controller
/// The new sequence
public static SwfWaitPlayStopped StopAndWaitPlay(
this SwfClipController ctrl, string sequence)
{
ctrl.Stop(sequence);
return WaitForPlayStopped(ctrl);
}
// ---------------------------------------------------------------------
//
// GotoAndStopAndWait[Event]
//
// ---------------------------------------------------------------------
/// Changes the animation frame with stops it
/// Yield instruction for wait animation play event
/// The clip controller
/// The new current frame
public static SwfWaitPlayStopped GotoAndStopAndWaitPlay(
this SwfClipController ctrl, int frame)
{
ctrl.GotoAndStop(frame);
return WaitForPlayStopped(ctrl);
}
/// Changes the animation sequence and frame with stops it
/// Yield instruction for wait animation play event
/// The clip controller
/// The new sequence
/// The new current frame
public static SwfWaitPlayStopped GotoAndStopAndWaitPlay(
this SwfClipController ctrl, string sequence, int frame)
{
ctrl.GotoAndStop(sequence, frame);
return WaitForPlayStopped(ctrl);
}
}
}