package de.movope.web;

import de.movope.domain.ChessBoard;
import de.movope.util.ChessGameUtils;

import java.util.Arrays;

public class ChessBoardView {

    private final PieceView[][] boardView;

    public ChessBoardView(ChessBoard board) {
        boardView = ChessGameUtils.getViewOfBoard(board);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ChessBoardView)) return false;

        return Arrays.deepEquals(boardView, ((ChessBoardView) o).boardView);
    }

    @Override
    public int hashCode() {
        return 55 + Arrays.hashCode(boardView);
    }
}

@@ -165,14 +165,8 @@
 ate 
-final 
 Piec
@@ -187,16 +187,53 @@
 dView;%0A%0A
+    public ChessBoardView() %7B%0A    %7D%0A%0A
     publ
@@ -328,23 +328,198 @@
 board);%0A
-
     %7D%0A%0A
+    public PieceView%5B%5D%5B%5D getBoardView() %7B%0A        return boardView;%0A    %7D%0A%0A    public void setBoardView(PieceView%5B%5D%5B%5D boardView) %7B%0A        this.boardView = boardView;%0A    %7D%0A%0A%0A
     @Ove

add methods and constructor that are neede for json-mapping