Skip to content

Commit

Permalink
fix: 플레이어 순서 버그 수정 2 #69
Browse files Browse the repository at this point in the history
  • Loading branch information
yhpark95 committed Nov 3, 2023
1 parent f21320a commit ea2f2ee
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ private GameStatus(Boolean isStarted, List<Player> players, List<Stock> stocks,
}

public void setOrder(Integer firstOrder) {
firstOrder--;
for (int i = 0; i < players.size(); i++) {
if (firstOrder + i != players.size()) {
players.get(i).setOrder(((firstOrder + i) % players.size()));
} else {
players.get(0).setOrder((firstOrder + players.size() + 1 + i) % players.size());
if (players.get(i).getOrder() == 0) {
players.get(i).setOrder(players.size());
}
log.info("설정된 오더 (아이디 + 오더)" + players.get(i).getPlayerId() + "/" + players.get(i).getOrder());
}

}

public void initCurrentPlayerInfo(Player player) {
Expand Down

0 comments on commit ea2f2ee

Please sign in to comment.