Skip to content

Commit

Permalink
Fix GameState.withStartingTilePlaced
Browse files Browse the repository at this point in the history
  • Loading branch information
Max committed Apr 2, 2024
1 parent 0964611 commit 733a95f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ch/epfl/chacun/GameState.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ public GameState withStartingTilePlaced() {
Preconditions.checkArgument(nextAction == Action.START_GAME);
PlacedTile startPlacedTile = new PlacedTile(tileDecks.topTile(Tile.Kind.START),
null, Rotation.NONE, Pos.ORIGIN, null);
return new GameState(
players, tileDecks.withTopTileDrawn(Tile.Kind.START), tileDecks.topTile(Tile.Kind.NORMAL),
// Draw the first tile from the start and normal tiles decks
TileDecks updatedDecks = tileDecks
.withTopTileDrawn(Tile.Kind.START).withTopTileDrawn(Tile.Kind.NORMAL);
return new GameState(players, updatedDecks, tileDecks.topTile(Tile.Kind.NORMAL),
board.withNewTile(startPlacedTile), Action.PLACE_TILE, messageBoard);
}

Expand Down

0 comments on commit 733a95f

Please sign in to comment.