Skip to content

Commit

Permalink
Update Game.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Antenehden committed Aug 6, 2024
1 parent 649b318 commit a73260d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/uta/cse3310/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public void setGameId(int gameId) {
this.gameId = gameId;
}

public int getGameId() {
return gameId;
}

public boolean addPlayer(Player player) {
if (players.size() < MAX_PLAYERS) {
players.add(player);
Expand Down Expand Up @@ -92,12 +96,15 @@ public void update(UserEvent event) {
switch (action) {
case "BUY_VOWEL":
currentRound.buyVowel(currentPlayer, event.getValue().charAt(0));
currentRound.waitingForInput = false;
break;
case "SELECT_CONSONANT":
currentRound.selectConsonant(currentPlayer, event.getValue().charAt(0));
currentRound.waitingForInput = false;
break;
case "SOLVE_PUZZLE":
currentRound.solvePuzzle(currentPlayer, event.getValue());
currentRound.waitingForInput = false;
break;
default:
System.out.println("Unknown action: " + action);
Expand All @@ -115,8 +122,10 @@ public void startGame() {

if (!inTestingMode) {
for(int i =0; i < 3; i++){
System.out.println("back in game");
isGameActive = true;
startNextRound();
System.out.println("back in game");

if(i == 2){
isGameActive = false;
determineWinner();
Expand Down

0 comments on commit a73260d

Please sign in to comment.