-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3단계 - 사다리(게임 실행) #1638
base: jwoo-o
Are you sure you want to change the base?
3단계 - 사다리(게임 실행) #1638
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진우님, 미션 구현하시느라 수고 많으셨습니다!!
간단한 몇 가지에 대해서만 피드백 남겨두었는데 한 번 확인해보시고 반영 부탁드릴게요 :) 추가로 코드 전체적으로 컨벤션이 일관적이지 않는데 intellij에서 제공하는 코드 포맷터를 이용해보시는 것도 좋을 것 같아요!!
} | ||
|
||
if (index == points.size()) { | ||
return points.get(index - 1) ? --index : index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
삼항 연산자를 사용하지 말고 코드를 작성해보면 좋을 것 같아요!!
@@ -0,0 +1,24 @@ | |||
package ladder.domain; | |||
|
|||
public class Result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 코드는 도메인으로 관리되기엔 도메인 로직이 없는 객체 같아요!! 혹시 어떠한 의도로 생성했을까요?
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class Results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 클래스도 일급 컬렉션으로 유의미하게 사용하고 싶다면 추가적인 도메인 로직을 담고 있다던지 하는게 더 좋을 것 같아요!!
return ladderResultService; | ||
} | ||
|
||
public List<String> getLadderResult(String targetPlayer, List<User> userList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하나의 함수에 너무 많은 파라미터를 받고 있어요!! 한번 파라미터의 개수를 줄일 수 있도록 리팩토링 해보는 것은 어떨까요?
|
||
private List<String> allLadderResult(List<User> userList, Ladder ladder, List<Result> results) { | ||
return IntStream.range(0, userList.size()) | ||
.mapToObj(index -> userList.get(index) + " : " + results.get(ladder.move(index))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 라인은 출력문의 로직이 아닐까요?
안녕하세요
3단계 완료해서 리뷰 부탁드립니다.