-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[step4] 자동차 경주(우승자) 리뷰 부탁드립니다 (#2077)
* [step4] 자동차 경주(우승자) 리뷰 부탁드립니다 * feat : 4단계 - 자동차 경주(우승자) 2021. 03. 15 자동차 경주(우승자)를 제출합니다. 1) 패키지로 UI, 도메인 분류 2) 자동차 참가회수 -> 자동차 이름으로 변경 3) 우승자 구분에 따른 기능 추가 4) 상수들을 상수 클래스로 관리 5) 기타 피드백 반영 Resolves : loop-study See also : changgunyee * refector(Cars): 자동차 사이즈 유효성 추가 2021. 03. 15 자동차 이름으로 ",,,,," 입력 시 자동차 Size 없이 진행되어 유효성 추가합니다. Resolves : loop-study See also : changgunyee * refactor(README) : 구현 목록 수정 2020. 03. 15 기존 3단계에서 추가된 4단계 구현 요소 추가함 Resolves : loop-study See also : changgunyee
- Loading branch information
1 parent
2610239
commit 83d927c
Showing
28 changed files
with
573 additions
and
376 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
package new_racingcar; | ||
|
||
import java.util.List; | ||
import new_racingcar.controller.RacingController; | ||
|
||
public class RacingMain { | ||
|
||
public static void main(String[] args) { | ||
InputView inputView = new InputView(); | ||
int playerCount = inputView.setPlayer(); | ||
int turnCount = inputView.setTurn(); | ||
|
||
GrandPrix grandPrix = new GrandPrix(playerCount, turnCount); | ||
List<Round> rounds = grandPrix.start(); | ||
|
||
ResultView resultView = new ResultView(); | ||
resultView.printGrandPrixRecords(rounds); | ||
RacingController racingController = new RacingController(); | ||
racingController.run(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package new_racingcar.constant; | ||
|
||
public class MsgConstants { | ||
|
||
// InputView Message | ||
public static final String INPUT_CAR_NAME_MESSAGE = "경주할 자동차 이름을 입력하세요(이름은 쉼표(,)를 기준으로 구분), 자동차당 최대 5글자 제한입니다"; | ||
public static final String INPUT_TURN_MESSAGE = "시도할 회수는 몇회인가요?"; | ||
public static final String INPUT_CAR_NAME_ERROR = "자동차 이름이 없습니다."; | ||
|
||
// ResultView Message | ||
public static final String RESULT_RACING_END_MESSAGE = "경기 결과"; | ||
|
||
// Cars, Car Message | ||
public static final String CAR_NAME_ERROR_MESSAGE = "자동차 이름이 잘못되었습니다."; | ||
|
||
// GrandPrix Message | ||
public static final String ROUND_ERROR_MESSAGE = "시도할 횟수가 잘못되었습니다."; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/new_racingcar/controller/RacingController.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package new_racingcar.controller; | ||
|
||
import new_racingcar.domain.Round; | ||
import new_racingcar.service.GrandPrix; | ||
import new_racingcar.view.InputView; | ||
import new_racingcar.view.ResultView; | ||
|
||
import java.util.List; | ||
|
||
public class RacingController { | ||
|
||
public void run() { | ||
InputView inputView = new InputView(); | ||
List<String> carNames = inputView.inputNames(); | ||
int turnCount = inputView.inputTurn(); | ||
|
||
GrandPrix grandPrix = new GrandPrix(carNames, turnCount); | ||
List<Round> rounds = grandPrix.start(); | ||
|
||
ResultView resultView = new ResultView(); | ||
resultView.printGrandPrixRecords(rounds); | ||
} | ||
} |
Oops, something went wrong.