Beispiel #1
0
        public void Tick()
        {
            //Debug.WriteLine("Tick #" + ticksInCurrentState + " in demandController: " + controllerState);
            switch (controllerState)
            {
            case DemandState.Startup:
                controllerState     = DemandState.Pending;
                ticksInCurrentState = 0;
                totalDemandFailures = 0;
                break;

            case DemandState.Pending:
                if (ticksInCurrentState > 3)
                {
                    DrawDemand();
                    controllerState = DemandState.Presented;
                }
                break;

            case DemandState.FinalSuccess:
                controllerState     = DemandState.Pending;
                ticksInCurrentState = 0;
                break;

            default:
                break;
            }
            ticksInCurrentState++;
        }
Beispiel #2
0
 void processDemandFinalSuccess(char c)
 {
     mainController.SpeakString("Great job, you pressed " + c);
     controllerState = DemandState.FinalSuccess;
 }