-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy pathLadderGameController.java
More file actions
33 lines (25 loc) · 967 Bytes
/
LadderGameController.java
File metadata and controls
33 lines (25 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package ladder;
import ladder.domain.ladder.Ladder;
import ladder.domain.player.Players;
import ladder.view.input.ConsoleInputView;
import ladder.view.input.InputView;
import ladder.view.output.OutputView;
public class LadderGameController {
private final InputView inputView;
private final OutputView outputView;
public LadderGameController(InputView inputView, OutputView outputView) {
this.inputView = inputView;
this.outputView = outputView;
}
public static void main(String[] args) {
LadderGameController game = new LadderGameController(new ConsoleInputView(), new OutputView());
game.run();
}
private void run() {
String inputNames = inputView.inputPlayerNames();
Players players = new Players(inputNames);
int height = inputView.inputLadderHeight();
Ladder ladder = new Ladder(height, players.count());
outputView.printResult(players, ladder);
}
}