Created
March 23, 2015 21:55
-
-
Save pumpkincouture/422bb4ffe89b4982b136 to your computer and use it in GitHub Desktop.
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
# GameRunner before | |
public class GameRunner { | |
public static void main(String[] args) { | |
SetUpGame setup = new SetUpGame(); | |
setup.startGame(); | |
} | |
} | |
# GameRunner after | |
public class GameRunner { | |
public static void main(String[] args) { | |
PrintStream output = new PrintStream(System.out); | |
Scanner input = new Scanner(System.in); | |
UserInterface ui = new CommandLineInterface(output, input); | |
List<Configurable> userChoices= new ArrayList<>(); | |
Configurable boardConfig = new BoardSize((CommandLineInterface) ui); | |
Configurable playerConfig = new ParticipantChoice((CommandLineInterface) ui); | |
Configurable orderConfig = new ParticipantOrder((CommandLineInterface) ui); | |
userChoices.add(boardConfig); | |
userChoices.add(playerConfig); | |
userChoices.add(orderConfig); | |
InputCollector inputCollector = new InputCollector(); | |
inputCollector.collectUserInput(userChoices); | |
SetUpTicTacToeGame setup = new SetUpTicTacToeGame(inputCollector.getUserValues()); | |
setup.setUpGame(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment