private void DispatcherTimer_Tick(object sender, object eo) { if(command != Server.Command.EMPTY) { switch (command) { case Server.Command.START: //souldn't get here break; case Server.Command.TERMINATE: stopGame(false); break; case Server.Command.GOAL_ROBOT: UpdateScore(false); break; case Server.Command.GOAL_PLAYER: UpdateScore(true); break; case Server.Command.EMPTY: //souldn't get here break; } command = Server.Command.EMPTY; } second += TimeSpan.FromMilliseconds(10); if(second < TimeSpan.FromMilliseconds(400)) { return; } second = TimeSpan.Zero; if (Countdown) // by time : { TimeSpaner -= TimeSpan.FromSeconds(1); } if (!Countdown) // by score : { TimeSpaner += TimeSpan.FromSeconds(1); } tb_Timer.Text = showTime(); if (Countdown && TimeSpaner == TimeSpan.FromSeconds(0)) { stopGame(false); } }
/// <summary> /// Procède à l'exécution de la commande donnée. /// </summary> public abstract void ProcessCommand(Server.Command command);