private void CountDownInGame_CoutDownEv(int time) { if (time < 0) // no response => end game { this.CountDownInGame.Stop(); //Time out if (this.InGameProperties.Status == StatusInGame.InTurn) { this.InGameProperties.Status = StatusInGame.NotReady; this.SendMessage(new TimeOutRequest()); this.SendMessage(new StatusGameRequest(StatusGame.Lose)); } else if (this.InGameProperties.Status == StatusInGame.Ready) { this.InGameProperties.WinGame += 1; this.SendMessage(new TimeOutRequest()); this.SendMessage(new StatusGameRequest(StatusGame.Win)); } this.SendMessage(new AcceptPlayRequest()); } else { UpdateCountDownRequest request = new UpdateCountDownRequest(); request.Time = time; this.SendMessage(request); } }
public virtual void OnUpdateCountDownRequest(UpdateCountDownRequest args) { if (UpdateCountDown != null) { UpdateCountDown(args); } }