game: Added custom message for no villages left

This commit is contained in:
Nathan Woodburn 2023-05-01 15:08:42 +10:00
parent 0a4f729108
commit da5d6dbdff
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -105,7 +105,14 @@ public class Game extends Application {
char typeC = 'S';
if (type == 1){
typeC = 'T';
if (currentGame.getCurrentPlayer().getVillages().length >= 5){
sendMessage("You have placed all your villages");
return;
}
}
if (currentGame.isMoveValid(selectedTile,typeC)){
currentGame.placePiece(selectedTile,typeC);
Player player = currentGame.getCurrentPlayer();