-
Notifications
You must be signed in to change notification settings - Fork 3
자바 야구 게임 완성 #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
base: chlwlgus4
Are you sure you want to change the base?
자바 야구 게임 완성 #5
Conversation
# Conflicts: # src/main/java/com/baseball/Baseball.java
honinbo6355
left a comment
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.
간단하게 리뷰 남겨놓았습니다.
각자 역할 별로 분리해서 재사용성을 높인 점 좋았던 것 같습니다!
중요한건 아니지만 실행 결과를 보니
랜덤 숫자가 863 이고 유저가 입력한 숫자가 862 일 경우
2 스트라이크가 나와야 하는데 2 스트라이크 1볼 이라고 나오고,
163 이라고 입력 했을 때는 2 스트라이크 2볼 이라고 나오더라구요.
한번 확인해보시면 좋을 것 같습니다.
수고하셨습니다.
| @Override | ||
| public void playGame() { | ||
| outputView.messagePrint("START", ""); | ||
| ball.userBall = InputView.inputBalls(); |
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.
setter 메소드로 값을 할당하지 않고 프로퍼티에 직접적으로 접근해서 할당한 이유가 궁금합니다
프로퍼티에 private 접근지시자를 쓰지않고 외부에서 값을 조작하게 된다면 보안에 취약하다고 알고 있어서요!
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.
음... 그냥 게터세터를 안쓰고 만들어 보고 싶어서 하긴했는데
조금 급하게 만드느라 미흡하게 만든것 같아요 ㅠㅠ
| outputView.messagePrint("VERIFICATION", ""); | ||
| InputView.getClose(); | ||
| e.printStackTrace(); | ||
| throw e; |
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.
catch 문에서 다시 에러를 throw 한다는 건 userBallNumberVerification 메소드를 호출한 곳에서 이 에러를 처리하겠다는 것 같은데(확실하진 않아요.. ㅠ) 딱히 보이지가 않아서요. 혹시 의도하신 건지 궁금합니다!
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.
원하던 것은 try/catch로 처리하려 했는데 좀 더 고민을 못하는 바람에..
안 맞는 값은 모두 익셉션 떨구도록.... 처리하였습니다.
No description provided.