Explain low level design for 2 player chess game, assume both players are human, the app is just providing a platform to the players.
Solution Overview:
1. will need player class, to represent the players containing details like: name, color.
2. Interface for piece, which all pieces( knight, king,.. ) will extend and implement valid move function, which based on piece's constraint return true or false.
3. Cell class for defining ech cell of grid board. Holding properties like x, y coordinate, color, currently occupied or not. If occupied then piece on cell.
4. Game class, having a 2D matrix of type grid, 2 Players. The constructor will initilize the game.
i. Functions to be exposed to UI are in this call.. and should internally call the functions of piece, grid & player.