Open
Conversation
2.LinkedType 패키지 변경
2. LadderGame 위치 변경 및 HashMap에서 Map으로 변경 3. 플레이어 수와 결과 수 validation 체크 로직 추가 4. GameResultDto 에서 GameInformationDto를 멤버변수로 가지고있지 않게 변경 5. 함수 static으로 변경 및 함수 분리
pci2676
reviewed
May 31, 2019
|
|
||
| public LadderGame(GameInformationDto gameInformationDto) { | ||
| this.gameInformationDto = gameInformationDto; | ||
| ladder = LadderGenerator.generate(gameInformationDto.getLadderHeight(),gameInformationDto.getPlayers().size()); |
Member
There was a problem hiding this comment.
이부분 파라미터를 gameInfomationDto를 넘기면 좀더 보기 편하고 파라미터 갯수도 줄일수 있지않을까
| List<User> userList = gameInformationDto.getPlayers(); | ||
| List<ExecuteResult> executeResults = gameInformationDto.getExecuteResult(); | ||
|
|
||
| Map<User, ExecuteResult> userPlayResult = getUserPlayResult(userList,executeResults); |
Member
There was a problem hiding this comment.
여기도 그냥 gameInformationDto를 넘기면 안되나??? 그러면 오히려 더 복잡해지나???
|
|
||
| for(int i = 1 ; i < playerNum - 1; i++){ | ||
| Point previous = points.get(i-1); | ||
| points.add(PointGenerator.generateNormalPoint(i+1,previous)); |
Member
There was a problem hiding this comment.
나는 이렇게 리스트에 add 하는 작업을 따로 하나의 메소드로 빼는게 더 읽기 좋은거같아
예를 들어서 지금 이 함수 첫줄에 add 하는거를 addFirstPoint 이런식으로 메소드 하나 만드는 것 처럼!
| List<Bridge> bridges = new ArrayList<>(); | ||
|
|
||
| for(int i = 0 ; i < ladderHeight ; i++){ | ||
| BridgeGenerator bridgeGenerator = new BridgeGenerator(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.