Last active
January 3, 2016 11:49
-
-
Save tarynsauer/8458332 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
| package tictactoe; | |
| public class MockGameSettings extends GameSettings { | |
| private UI ui; | |
| private int boardSize; | |
| private Player playerOne; | |
| private Player playerTwo; | |
| private Player playerFirstMove; | |
| public MockGameSettings() { | |
| } | |
| public void getAllSettings() { | |
| this.ui = new UI(); | |
| this.playerOne = returnPlayer("X"); | |
| this.playerTwo = returnPlayer("O"); | |
| this.playerFirstMove = randomizePlayerFirstMove(); | |
| returnBoardSize(); | |
| } | |
| public int getBoardSize() { | |
| return this.boardSize; | |
| } | |
| public Player getPlayerOne() { | |
| return this.playerOne; | |
| } | |
| public Player getPlayerTwo() { | |
| return this.playerTwo; | |
| } | |
| public void setPlayerOne(Player player) { | |
| this.playerOne = player; | |
| } | |
| public void setPlayerTwo(Player player) { | |
| this.playerTwo = player; | |
| } | |
| public Player getPlayerFirstMove() { | |
| return this.playerFirstMove; | |
| } | |
| public void setUI(UI ui) { | |
| this.ui = ui; | |
| } | |
| public Player randomizePlayerFirstMove() { | |
| return this.playerOne; | |
| } | |
| public Player returnPlayer(String marker) { | |
| return new HumanPlayer(marker); | |
| } | |
| public void returnBoardSize() { | |
| this.boardSize = 3; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment