added more logic for the server state diagram

This commit is contained in:
Daniel Grigencha
2024-11-24 15:27:10 +01:00
parent cd22ece485
commit f425eff26b
8 changed files with 80 additions and 11 deletions

View File

@@ -29,6 +29,8 @@ public class Game {
private Boolean allRanked = false;
private Boolean movablePieces = false;
private Boolean allReady = false;
private static final int AMOUNT_OF_TURBO_CARDS = 16;
private static final int AMOUNT_OF_SHIELD_AND_SWAP_CARDS = 12;
@@ -397,6 +399,25 @@ public void setStartPlayer(Player startPlayer) {
this.startPlayer = startPlayer;
}
/**
* This method returns the all ready state.
*
* @return the all ready state
*/
public Boolean allReady() {
return allReady;
}
/**
* This method sets the all ready state.
*
* @param allReady the new all ready state
*/
public void setAllReady(Boolean allReady) {
this.allReady = allReady;
if (allReady) notifyObservers();
}
/**
* This method notifies the observers.
*/