Result.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        if(i == true) // denna if-sats är till för att spelet inte ska kolla en gång till efter att det redan är gjort.
        {

                        if(winner.DiDIWin() == true) //Kollar i GameBrain om spelaren vann.
                           {

                                new EnableDis(win);
                                new EnableDis(playAgain);
                                new EnableDis(mainMenu);

                                    i = false;

                            }
                        if (loser.DidILose() == true) //Kollar i GameBrain om spelaren förlorade.
                        {
                        new EnableDis(fail);
                        new EnableDis(tryAgain);
                        new EnableDis(mainMenu);

                     				i = false;
                        }
        }
    }

Usage Example

コード例 #1
0
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     if (buttonStart.Text == "开始")
     {
         LOG.Clear();
         Result.Text      = "等待中";
         Result.BackColor = Color.Orange;
         Result.Update();
         buttonStart.Text = "结束";
         buttonStart.Update();
         runCa = new Thread(Runcal);
         runCa.Start();
     }
     else if (buttonStart.Text == "结束")
     {
         Result.Text      = "停止";
         Result.BackColor = Color.Orange;
         Result.Update();
         buttonStart.Text = "开始";
         buttonStart.Update();
         runCa.Abort();
         runCa.Join();
     }
     c2000.Text      = "待校准";
     c2000.BackColor = Color.Orange;
     c1040.Text      = "待校准";
     c1040.BackColor = Color.Orange;
     c800.Text       = "待校准";
     c800.BackColor  = Color.Orange;
     c500.Text       = "待校准";
     c500.BackColor  = Color.Orange;
     return;
 }
All Usage Examples Of Result::Update