-
Notifications
You must be signed in to change notification settings - Fork 10
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
[로또 게임] 인수빈 2차 과제 제출합니다. #13
base: main
Are you sure you want to change the base?
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.
전반적으로 MVC 패턴을 적용하려는 노력이 보였습니다. 나중에는 패키징도 같이 신경써주면 좋겠습니다.
@@ -0,0 +1,24 @@ | |||
package lotto; | |||
|
|||
public enum LOTTOERROR { |
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.
enum 클래스는 enum 클래스 자체보다는 객체들을 대문자로만 표현합니다.
enum LottoError {
STRING_ERROR
...
}이런식으로요
boolean bonusFlag = false; | ||
for(int userNum : userNumbers){ | ||
for(int num : numbers){ | ||
if(num == userNum) cnt++; |
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.
전에도 말했지만 indent 3이상은 지양해주세요
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.
contains 라는 함수를 이용할수 있을것 같아요
@@ -0,0 +1,18 @@ | |||
package lotto; | |||
|
|||
public enum VALUESETTING { |
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.
LOTTOERROR 와 같은 피드백을 드립니다.
@@ -15,6 +20,40 @@ private void validate(List<Integer> numbers) { | |||
throw new IllegalArgumentException(); | |||
} | |||
} | |||
public List<Integer> getNumbers(){ |
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.
굳이 이 번호 전체를 getter로 가져와야만 할까요?
get(index) 와 같은 함수를 구현해도 괜찮지 않을까요?
@@ -0,0 +1,57 @@ | |||
package lotto; | |||
|
|||
public class LottoGameController { |
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.
run을 제외한 함수들은 private으로 구현할 수 있겠네요.
private int amount; | ||
private Lotto[] lottos; | ||
public LottoSeller(){} | ||
public LottoSeller(String priceInput){ |
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.
생성자에서 로직이 실행되네요 적합하지 않다고 생각합니다.
sellLottos(); | ||
} | ||
public void validate(String priceInput){ | ||
ErrorChecker checker = new ErrorChecker(); |
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.
LottoSeller는 ErrorChecker에게 의존성이 있네요.
의존성주입 혹은 의존성 검색을 통해 의존성을 부여해보세요
winningNumbers = changeNumbersType(winningNumbersInput); | ||
} | ||
public void validate(String[] winningNumbersInput){ | ||
ErrorChecker checker = new ErrorChecker(); |
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.
의존성관련 같은 질문피드백을 드립니다. 무분별한 생성은 지양합시다.
System.out.println("당첨 번호를 입력해주세요."); | ||
} | ||
public void printBonusNumberInputMessage(){ | ||
System.out.println("보너스 번호를 입력해주세요."); |
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.
출력값이 변동되면 어떡하죠? 출력값도 ENUM으로 상수로 관리하는게 좋다고 생각합니다.
upload2 확인해주시면 될 것 같습니다!