コード例 #1
0
ファイル: Form1.cs プロジェクト: ninoaguilar/Battleship
 void resetUI()
 {
     controller = new GameController();
             startButton.Text = "Start Game";
             turnLabel.Text = "Arrange Your Ships";
             playerScore = 0;
             playerScoreLabel.Text = "Your Score: " + playerScore + "/17";
             compScore = 0;
             label42.Text = "Enemy Score: " + compScore + "/17";
             canPlaceShips = true;
             restarting = false;
             controller.setPlayerTurn(0);
             for (int i = 0; i < 10; i++)
             {
                 for (int j = 0; j < 10; j++)
                 {
                     playerGridButtons[i][j].BringToFront();
                     enemyGridButtons[i][j].BackColor = Color.Transparent;
                     enemyGridButtons[i][j].BringToFront();
                     playerGridButtons[i][j].BackColor = Color.Transparent;
                 }
             }
             this.ship2PictureBox.Visible = true;
             this.ship3aPictureBox.Visible = true;
             this.ship3bPictureBox.Visible = true;
             this.ship4PictureBox.Visible = true;
             this.ship5PictureBox.Visible = true;
     this.ship2PlacedPictureBox.Visible = true;
     this.ship3aPlacedPictureBox.Visible = true;
     this.ship3bPlacedPictureBox.Visible = true;
     this.ship4PlacedPictureBox.Visible = true;
     this.ship5PlacedPictureBox.Visible = true;
     this.ship2PlacedPictureBox.BringToFront();
     this.ship3aPlacedPictureBox.BringToFront();
     this.ship3bPlacedPictureBox.BringToFront();
     this.ship4PlacedPictureBox.BringToFront();
     this.ship5PlacedPictureBox.BringToFront();
     computer = new AIPlayer();
             Board.resetBoard();
             singlePlayerMode();
 }