Skip to content

Commit f65fa78

Browse files
author
github-actions
committed
chore: Java 스타일 수정
1 parent cba6387 commit f65fa78

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/GameService.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ public void gameEnd(Room room) {
172172
Map<String, Player> playerSessionMap = room.getPlayerSessionMap();
173173

174174
// TODO : 랭킹 정보 업데이트
175-
GameResultListResponse gameResultListResponse = toGameResultListResponse(playerSessionMap,
176-
room.getRound());
175+
GameResultListResponse gameResultListResponse =
176+
toGameResultListResponse(playerSessionMap, room.getRound());
177177

178178
messageSender.sendBroadcast(
179179
destination,
@@ -210,7 +210,7 @@ private void updateRank(Room room, GameResultListResponse gameResultListResponse
210210

211211
List<GameResultResponse> result = gameResultListResponse.result();
212212

213-
for(GameResultResponse gameResultResponse : result) {
213+
for (GameResultResponse gameResultResponse : result) {
214214
Long playerId = gameResultResponse.id();
215215
int rank = gameResultResponse.rank();
216216
int score = gameResultResponse.score();
@@ -222,13 +222,12 @@ private void updateRank(Room room, GameResultListResponse gameResultListResponse
222222
continue;
223223
}
224224

225-
if(rank == 1) {
225+
if (rank == 1) {
226226
statService.updateRank(playerId, true, score);
227227
continue;
228228
}
229229

230230
statService.updateRank(playerId, false, score);
231-
232231
}
233232
}
234233

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
package io.f1.backend.domain.game.dto.response;
22

3-
public record GameResultResponse(Long id, String nickname, int score, int totalCorrectCount, int rank) {}
3+
public record GameResultResponse(
4+
Long id, String nickname, int score, int totalCorrectCount, int rank) {}

backend/src/main/java/io/f1/backend/domain/game/mapper/RoomMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ public static GameResultResponse toGameResultResponse(
121121
double correctRate = (double) player.getCorrectCount() / round;
122122
int score = (int) (correctRate * 100) + (totalPlayers - rank) * 5;
123123

124-
return new GameResultResponse(player.id, player.nickname, score, player.getCorrectCount(), rank);
124+
return new GameResultResponse(
125+
player.id, player.nickname, score, player.getCorrectCount(), rank);
125126
}
126127

127128
public static GameResultListResponse toGameResultListResponse(

0 commit comments

Comments
 (0)