예제 #1
0
 private void StopAllTimers()
 {
     waitForOtherPlayerTimer.Stop();
     isConnectedTimer.Stop();
     CheckIfSomeoneJoinedToGameTimer.Stop();
     CheckIfSomeoneSetUpAnewGame.Stop();
 }
예제 #2
0
 private void WaitForOtherPlayerTimer_Tick(object sender, EventArgs e)
 {
     if (_isConnectedToServer)
     {
         _waitingTime         -= 1;
         createGameButton.Text = "Oczekiwanie na przeciwnika (" + _waitingTime.ToString() + "s" + ")";
         if (_waitingTime == 0)
         {
             _thisStationSetUpANewGame = false;
             waitForOtherPlayerTimer.Stop();
             _waitingTime = 10;
             playerNameTextBox.Enabled = true;
             DeletePlayersFromWaitingRoom();
             CheckIfSomeoneJoinedToGameTimer.Stop();
             waitForOtherPlayerTimer.Stop();
             EnableButtons(true);
             createGameButton.Text = "Stwórz grę";
         }
     }
 }