-
Notifications
You must be signed in to change notification settings - Fork 5
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
[혁] 레이싱 게임 #18
base: master
Are you sure you want to change the base?
[혁] 레이싱 게임 #18
Conversation
혁 레이싱 게임 브랜치 머지 fork/yh -> original/yh
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.
특정 행동을 하는 상태값들을 한곳에서 같이 처리할 수 있도록 응집도를 올려보자
int maxDistance = racingTurns.getMaxDistance(); | ||
List<Integer> lastTurnCarDistances = racingTurns.getLastTurnCarDistances(); | ||
return IntStream.range(0, carNames.size()) | ||
.boxed() | ||
.filter(i -> lastTurnCarDistances.get(i) == maxDistance) | ||
.map(i -> carNames.get(i)) | ||
.collect(Collectors.toList()); |
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.
Winner는 distance와 name으로 결정되는데 그 상태들이 서로 따로 행동하고 있어
나느 응집도가 떨어지는것으로 보이는데 이 상태값들을 하나로 관리할 수 있는 방향으로 리팩토링을 다시 해보면 좋을 것 같아
그렇게 되면 여러 책임이 다른 객체에게 위임될 수 있을것 같아
original / yh -> original / master PR