コード例 #1
0
ファイル: Game.cs プロジェクト: Besobod/ChessGame
        public void InitializeGame()
        {
            for (int i = 0; i < Board.GetLength(1); i++)
            {
                Board[6, i] = new Pawn(Color.White);
            }
            Board[7, 0] = new Rook(Color.White);
            Board[7, 1] = new Knight(Color.White);
            Board[7, 2] = new Bishop(Color.White);
            Board[7, 3] = new Queen(Color.White);
            Board[7, 4] = new King(Color.White);
            Board[7, 5] = new Bishop(Color.White);
            Board[7, 6] = new Knight(Color.White);
            Board[7, 7] = new Rook(Color.White);

            for (int i = 0; i < Board.GetLength(1); i++)
            {
                Board[1, i] = new Pawn(Color.Black);
            }
            Board[0, 0] = new Rook(Color.Black);
            Board[0, 1] = new Knight(Color.Black);
            Board[0, 2] = new Bishop(Color.Black);
            Board[0, 3] = new Queen(Color.Black);
            Board[0, 4] = new King(Color.Black);
            Board[0, 5] = new Bishop(Color.Black);
            Board[0, 6] = new Knight(Color.Black);
            Board[0, 7] = new Rook(Color.Black);
        }