[포키 && 필] 로또 3단계 - 수동구매 기능 추가#55
Open
PhilSoGooood wants to merge 7 commits intocodesquad-members-2022:PhilSoGoooodfrom
Open
[포키 && 필] 로또 3단계 - 수동구매 기능 추가#55PhilSoGooood wants to merge 7 commits intocodesquad-members-2022:PhilSoGoooodfrom
PhilSoGooood wants to merge 7 commits intocodesquad-members-2022:PhilSoGoooodfrom
Conversation
gitignore.io를 활용해서 macOS, java, gradle, intellij를 추가하였습니다.
Lotto 각 티켓의 결과 비교는 WinningLotto가 담당하고 위 결과를 종합하고 당첨금 및 수익률 계산은 LottoGam이 담당합니다. LottoResult는 각 등수가 몇번 있었는지 결과를 담는 역할을 담당합니다. Rank의 체크 메서드를 분리하여 null값을 반환하지 않도록 수정하였습니다.
controller의 로또 티켓 생성을 통해 바로 Ticket을 반환하도록 변경하였습니다.
타입을 변경하였습니다. scanner의 초기화 및 close를 담당하는 메서드를 구현하였습니다. model의 각 클래스가 변경됨에 따라 이에 맞도록 OutputView의 각 메서드의 매개변수의 타입을 변경하였습니다.
gradle로 프로젝트를 변경함에 따라 빌드 파일을 추가합니다.
수동 구매 수량 및 해당 수량만큼 수동 번호를 입력 받는 기능을 구현하였습니다.
구매금액과 수동 구매 수량, 당첨번호, 보너스 번호 입력에 대해 예외처리를 하도록 했습니다.
wheejuni
requested changes
Feb 26, 2022
wheejuni
left a comment
There was a problem hiding this comment.
수고 많으셨습니다. 👍
코멘트 확인해주시고요, 테스트 코드가 너무 없군요.
테스트에도 조금 관심을 부탁드려요~
| int ticketCount = calculateTicketAmounts(purchaseAmount); | ||
| LottoTickets lottoTickets; | ||
| if (manualCount > 0) { | ||
| List<List<Integer>> manualNumbers = inputView.inputManualNumbers(manualCount); |
There was a problem hiding this comment.
List<Integer> 는 여기에서 어떤 의미를 갖나요? 로또 번호에 대한 사용자 입력, 혹은 로또번호의 집합 그 자체가 될 수 있을 것 같은데요...
이걸 적절히 감싸서 리스트를 원소로 갖는 리스트, 즉 List<List<Integer>> 를 쓰지 않도록 리팩터링 부탁드려요.
Comment on lines
+8
to
+15
| List<Lotto> ticketList = tickets.getTickets(); | ||
| LottoResult result = new LottoResult(); | ||
|
|
||
| for (Lotto lotto : ticketList) { | ||
| int ticketResult = winningNumbers.compareTicket(lotto.getTicket()); | ||
| boolean bonusResult = winningNumbers.compareBonusNumber(lotto.getTicket()); | ||
| result.check(ticketResult, bonusResult); | ||
| } |
There was a problem hiding this comment.
이 로직은 LottoTickets 에 있어야 할 겁니다.
공들여 일급 컬렉션 객체를 설계했는데 그걸 그냥 게터를 호출해서 값을 가져오고, 일급 객체 외부에서 로직을 수행한다면 다소 아쉬운 구현이라고 볼 수 있겠죠. 이걸 LottoTickets 로 옮기는 방향으로 리팩토링 부탁드려요.
| return matchedCount; | ||
| } | ||
|
|
||
| private int containNumber(int number) { |
There was a problem hiding this comment.
여기서 boolean을 리턴했다면 compareTicket() 을 스트림 기반으로 리턴할 수 있지 않을까요?
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.
안녕하세요 리뷰어님!
포키와 필입니다.
로또 3단계 기능을 구현해서 PR 보냅니다.
그 과정에서 로또는 하지 않는게 좋다는 교훈을 얻었습니다.
감사합니다 주말 잘보내세요! :)
2단계 리뷰 반영사항
기능 요구사항
프로그래밍 요구사항