Otter  0.9.88
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Coroutine Class Reference

Class that manages Coroutines. More...

Public Member Functions

 Coroutine ()
 Create a new Coroutine manager. More...
 
int Start (IEnumerator routine)
 Starts a new coroutine and returns an int id for that routine. More...
 
void StopAll ()
 Immediately clear and stop all Coroutines. More...
 
void Stop (int routineId)
 Stop a routine from running based off its int id. More...
 
void Update ()
 Updates all the routines. The coroutine in the Game automatically runs this. More...
 
void PublishEvent (string id)
 Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update. More...
 
void PublishEvent (Enum id)
 Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update. More...
 
IEnumerator WaitForEvent (string id)
 Waits until a specific event has been published. More...
 
IEnumerator WaitForEvent (Enum id)
 Waits until a specific event has been published. More...
 
bool HasEvent (string id)
 Check if an event has been published. More...
 
bool HasEvent (Enum id)
 Check if an event has been published. More...
 
IEnumerator WaitForSeconds (float seconds)
 Waits until an amount of time has passed. More...
 
IEnumerator WaitForFrames (int frames)
 Waits until an amount of frames have passed. Don't use this with non-fixed framerates. More...
 

Static Public Attributes

static Coroutine Instance
 The reference to the main Coroutine object managed by Otter. More...
 

Properties

int Count [get]
 The current number of running routines. More...
 
bool Running [get]
 If any routines are currently running. More...
 

Detailed Description

Class that manages Coroutines.

Constructor & Destructor Documentation

Otter.Coroutine.Coroutine ( )

Create a new Coroutine manager.

Member Function Documentation

bool Otter.Coroutine.HasEvent ( string  id)

Check if an event has been published.

Parameters
idThe string id of the event.
Returns
True if the event has been published.
bool Otter.Coroutine.HasEvent ( Enum  id)

Check if an event has been published.

Parameters
idThe enum id of the event.
Returns
True if the event has been published.
void Otter.Coroutine.PublishEvent ( string  id)

Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update.

Parameters
idThe string id of the event.
void Otter.Coroutine.PublishEvent ( Enum  id)

Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update.

Parameters
idThe enum id of the event.
int Otter.Coroutine.Start ( IEnumerator  routine)

Starts a new coroutine and returns an int id for that routine.

Parameters
routineThe coroutine to start running.
Returns
A unique int id for that routine.
void Otter.Coroutine.Stop ( int  routineId)

Stop a routine from running based off its int id.

Parameters
routineIdThe id of the routine to stop.
void Otter.Coroutine.StopAll ( )

Immediately clear and stop all Coroutines.

void Otter.Coroutine.Update ( )

Updates all the routines. The coroutine in the Game automatically runs this.

IEnumerator Otter.Coroutine.WaitForEvent ( string  id)

Waits until a specific event has been published.

Parameters
idThe string id of the event.
Returns
IEnumerator Otter.Coroutine.WaitForEvent ( Enum  id)

Waits until a specific event has been published.

Parameters
idThe enum id of the event.
Returns
IEnumerator Otter.Coroutine.WaitForFrames ( int  frames)

Waits until an amount of frames have passed. Don't use this with non-fixed framerates.

Parameters
framesThe number of frames to wait.
Returns
IEnumerator Otter.Coroutine.WaitForSeconds ( float  seconds)

Waits until an amount of time has passed.

Parameters
secondsThe number of seconds to wait.
Returns

Member Data Documentation

Coroutine Otter.Coroutine.Instance
static

The reference to the main Coroutine object managed by Otter.

Property Documentation

int Otter.Coroutine.Count
get

The current number of running routines.

bool Otter.Coroutine.Running
get

If any routines are currently running.


The documentation for this class was generated from the following file: