CRaPI - Correct Robust and Perfect API

Clock.OnTick Method 

When the internal CRaPI clock ticks the subsribed events will be raised due to its specified raise condtions TickPlayOn

protected void OnTick(
   object o,
   ElapsedEventArgs e
);

Parameters

o
The subscribed object
e
The elapsed event argument

Remarks

To get these events you have to subscribe them

Events

Event TypeReason
TickPlayOnRaised every specified time interval if the games state is play on
TickPlayOffRaised every specified time interval if the game state is play off
TickOnCycleSoonEndingRaised when cycle is soon ending
TickOverTimeOnCycleRaised when time has passed a cycle duration

Example

This sample shows how to subscribe events in your code.

            Clock mClock = new Clock();
            mClock.TickPlayOn += new TimeEventHandler(OnTick);
            mClock.TickPlayOff += new TimeEventHandler(OnTick);
            
            public void OnTick(object sender, TimeEventArgs e)
            {
            	Do something...
            }
            

See Also

Clock Class | TeamYaffa.CRaPI Namespace