Example #1
0
        //  -- Load state of ChessBoard from given turn.
        public void LoadSnapshot(int loadTurn)
        {
            ChessBoardSnapshot snapshot = match.GetSnapshot(loadTurn);

            ClearBoard();
            foreach (PieceSnapshot pieceSnapshot in snapshot.pieceSnapshots)
            {
                Piece piece = pieceSnapshot.LoadSnapshot();
                squares[piece.column - 1, piece.row - 1].AddPiece(piece);
            }
            turn = loadTurn;
        }
Example #2
0
 public void SaveSnap(ChessBoardSnapshot snapshot)
 {
     snapshots.Add(snapshot); turns++;
 }