示例#1
0
文件: Form1.cs 项目: grodg/Battleship
 //button click event handler that handles creating destroyer of Board A
 private void CreateDestroyerA(object sender, EventArgs e)
 {
     if (DestroyerA.DestroyerACount() < 2 && DestroyerA.DestroyerACount() > 0)
     {
         boatsettingPoint2DestroyerA(sender, e);
     }
     if (DestroyerA.DestroyerACount() == 0)
     {
         ((Button)sender).BackColor = Color.Orange;
         ((Button)sender).Enabled   = false;
         btnOk1.Visible             = true;
         DestroyerA.DestroyerADecrement();
         disableBoardA();
         MessageBox.Show("Click OK at the top to complete your ship setting", "Ships Complete");
     }
     if (DestroyerA.DestroyerACount() == 2)
     {
         ((Button)sender).BackColor = Color.Orange;
         ((Button)sender).Enabled   = false;
         boatSettingPoint1A(sender, e);
         DestroyerA.DestroyerADecrement();
     }
 }