You made abstraction Player
over Human
and CPU
. I think all your arrows must use the common one Player
. For example:
class Chessboard {
Player p1;
Player p2;
}
It is more convenient way, and you can change in runtime your players and different game modes: Human vs Human, Human vs CPU, even CPU vs CPU
The same changes applied to GameEngine.
By the way, I don't think it is a good idea to player aggregate controlled chessmen. All control over Chessman
nut be responsibility of Chessboard
, and player just send him a message when he want to make a move in his turn.
That change allows you to have several chessboards per player for multi-table game.