/// <summary>
        /// Создаёт новую игру для двух игроков.
        /// </summary>
        /// <param name="player1">Первый игрок.</param>
        /// <param name="player2">Второй игрок.</param>
        public GameModel(Player player1, Player player2)
        {
            this.player1 = player1;
            this.player2 = player2;

            figures = new ChessFigures();
            board = figures.LoadBoard(ChessBoard.DefaultBoard);
        }
        public string SaveBoard(ChessBoard board)
        {
            StringBuilder savedBoard = new StringBuilder("");

            for (int row = board.Rows - 1; row >= 0; --row) {
                for (int col = 0; col < board.Columns; ++col) {
                    savedBoard.Append(SaveFigure(board.Array[col, row]));
                    savedBoard.Append(' ');
                }
                savedBoard.Append('\n');
            }

            return savedBoard.ToString();
        }
        public ChessBoard LoadBoard(string savedBoard)
        {
            ChessBoard board = new ChessBoard();

            string[] rows = savedBoard.Split(new char[] {'\n', '\r'}, StringSplitOptions.RemoveEmptyEntries);
            for (int row = board.Rows - 1; row >= 0; --row) {
                string[] columns = rows[row].Split(new char[] {' ', '\t'}, StringSplitOptions.RemoveEmptyEntries);
                for (int col = 0; col < board.Columns && col < rows[row].Length; ++col) {
                    board.Array[col, row] = LoadFigure(columns[col]);
                }
                for (int col = rows[row].Length; col < board.Columns; ++col) {
                    board.Array[col, row] = ChessFigure.None;
                }
            }

            return board;
        }