Ejemplo n.º 1
0
        private void ProcessConfirmedCommand(GlobalCommand cmd)
        {
            if (cmd.CommandToConfirm == null)
            {
                return;
            }

            switch (cmd.CommandToConfirm.Code)
            {
            case GlobalCommandCodes.StartFinish:
                if (Race.IsRunning)
                {
                    FinishRace();
                }
                break;

            case GlobalCommandCodes.ResetAll:
                ResetAll();
                break;

            case GlobalCommandCodes.ClearAll:
                ClearAll();
                break;
            }
        }
Ejemplo n.º 2
0
        private void ProcessClickCommand(GlobalCommand cmd)
        {
            switch (cmd.Code)
            {
            case GlobalCommandCodes.StartFinish:
                if (Race.IsRunning)
                {
                    MessagingHub.Send(QueueType.AskConfirmation, GlobalCommand.AskConfirmation(cmd, "Do you really want to finish the race?"));
                }
                else
                {
                    StartRace();
                }
                break;

            case GlobalCommandCodes.ResetAll:
                if (Race.IsRunning)
                {
                    MessagingHub.Send(QueueType.AskConfirmation, GlobalCommand.AskConfirmation(cmd, "Do you really want to reset after start?"));
                }
                else
                {
                    ResetAll();
                }
                break;

            case GlobalCommandCodes.ResetTime:
                Race.ResetTimeOnCheckpoint();
                break;

            case GlobalCommandCodes.ClearAll:
                MessagingHub.Send(QueueType.AskConfirmation, GlobalCommand.AskConfirmation(cmd, "Delete all data?"));
                break;

            case GlobalCommandCodes.GPSReset:
                MessagingHub.Send(QueueType.Global, cmd);
                break;

            case GlobalCommandCodes.Turn:
                MakeATurn();
                break;

            case GlobalCommandCodes.Back:
                GoBack();
                break;

            case GlobalCommandCodes.DelSegment:
                Race.DeleteLastSegment();
                break;
            }
        }
Ejemplo n.º 3
0
 private void ProcessCanceledCommand(GlobalCommand cmd)
 {
     //do nothing
 }