コード例 #1
0
 private void readyUpButton_Click(object sender, EventArgs e)
 {
     readyUpButton.Enabled = false;
     if (serverUser)
     {
         serverReady = true;
     }
     if (clientUser)
     {
         clientReady = true;
     }
     if (!clientReady || !serverReady)
     {
         WaitForm w = new WaitForm(this);
         w.Show();
         while (clientReady || serverReady)
         {
             SpinWait.SpinUntil(ReadyUp, 1000);
             if (clientReady && serverReady)
             {
                 break;
             }
         }
     }
     if (clientReady && serverReady)
     {
         this.Hide();
         GameBoardForm g = new GameBoardForm();
         g.Closed += (s, args) => this.Close();
         g.Show();
         readyCount = 0;
     }
 }
コード例 #2
0
 public WinnerForm(String results, GameBoardForm game)
 {
     InitializeComponent();
     winnerLabel.Text = results;
     gb = game;
 }