la til mulighet til å loade et manuellt test game

This commit is contained in:
Tobydrama 2020-05-03 15:08:39 +02:00
parent 2f528c16bc
commit 290423cf38

View File

@ -34,6 +34,7 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
private List<ProgrammingCard> program; private List<ProgrammingCard> program;
private ProgrammingCardDeck playerHand; private ProgrammingCardDeck playerHand;
private ProgrammingCardDeck extraCards; private ProgrammingCardDeck extraCards;
private Boolean testingMode;
/** /**
* Instantiates a new Robo Rally game * Instantiates a new Robo Rally game
@ -44,7 +45,8 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
* @param server The server if this player is host. Should be null otherwise * @param server The server if this player is host. Should be null otherwise
*/ */
public RoboRallyGame(List<Player> playerList, String boardName, String playerName, public RoboRallyGame(List<Player> playerList, String boardName, String playerName,
RoboRallyServer server) { RoboRallyServer server,Boolean testingMode) {
this.testingMode=testingMode;
this.playerName = playerName; this.playerName = playerName;
this.host = server != null; this.host = server != null;
this.playerList = playerList; this.playerList = playerList;
@ -244,9 +246,15 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
TileType.FLAG_4, TileType.WRENCH, TileType.WRENCH_AND_HAMMER); TileType.FLAG_4, TileType.WRENCH, TileType.WRENCH_AND_HAMMER);
if (host) { if (host) {
if(testingMode){
mainDeck = DeckLoaderUtil.loadProgrammingCardsTestDeck();
}
else{
mainDeck = DeckLoaderUtil.loadProgrammingCardsDeck(); mainDeck = DeckLoaderUtil.loadProgrammingCardsDeck();
} }
}
phase = new Phase(gameBoard, playerList, 600, this); phase = new Phase(gameBoard, playerList, 600, this);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();