Last active
June 11, 2021 08:33
-
-
Save sidd-kulk/524776969f8e2ff6b3d66dea025fe183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum COLOR { | |
WHITE, BLACK | |
} | |
enum PIECE { | |
NONE, BISHOP, KING // etc. | |
} | |
class Cell { | |
private COLOR color; // Enum, white or black | |
private PIECE piece; | |
public Cell(COLOR color, PIECE piece) { | |
this.color = color; | |
this.piece = piece; | |
} | |
public void setPiece(PIECE piece) { | |
// validations | |
this.piece = piece; | |
} | |
// much more functionality | |
} | |
class ChessBoard { | |
private List<Cell> cells; | |
private String theme; | |
public ChessBoard(List<Cell> cells, String theme) { | |
this.cells = cells; | |
this.theme = theme; | |
} | |
// much more functionality | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment