Open
Conversation
OutputView 객체를 통해 기능 선택에 대한 안내 문구를 우선 출력한다. 기능 선택에 대한 안내 문구는 Message, CommandMessage, Command 등의 객체의 상수를 활용한다. InputView 객체에서 기능 선택에 대한 사용자의 입력을 받는다. InputView 객체에서 사용자의 입력이 한 개 문자로 입력되는지 검증한다.
PairMatchingController 객체는 기능 명령어를 입력받아 검증하는 기능을 수행한다. 명령어 1, 2, 3, Q 문자 중 하나인지 확인하고, 이에 해당하지 않을 경우 IllegalArgumentException 을 발생시킨다.
OutputView는 안내 메시지를 출력한다. 안내 메시지를 만들 때 Controller 에서 Course, Level, Mission 객체에 대한 데이터를 전달받는다. InputView는 사용자의 입력을 읽는다. 사용자의 입력이 입력 형식에 알맞는지 확인하고, 알맞지 않을 시 오류를 발생시킨다.
변경 전 : PairMatchingProgram 객체에서 명령어 검증을 담당한다. 변경 후 : UserCommand 객체에서 명령어 검증을 담당한다. 변경 이유 : 객체 간 책임을 분리하기 위해서이다.
ChoiceMaker 객체가 과정, 미션, 레벨에 대한 검증을 담당한다. 사용자가 입력한 과정, 미션, 레벨 각각이 존재하는지 여부와 입력한 미션과 레벨이 서로 일치하는지 여부를 검증한다.
각 객체마다 valueOf(Class) 메소드를 구현한다. 기존에 valueOf 메소드를 사용한 것을 valueOf(Class) 등으로 수정한다.
PairMatchingProgram 객체의 hasMatched 메소드는 Choice 객체를 전달받아 해당하는 선택의 매칭이 이뤄졌는지 확인한 결과를 반환한다.
매칭 이력이 있는 경우, 재매칭 여부를 사용자에게 입력받을 수 있도록 구현한다. 재매칭 여부 입력이 1~3 글자의 한글이 아닌 경우 오류를 발생시킨다.
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.