From 2f528c16bc7490f653facf2b08bf54d7f6595206 Mon Sep 17 00:00:00 2001 From: Tobydrama Date: Sun, 3 May 2020 15:07:38 +0200 Subject: [PATCH] =?UTF-8?q?la=20til=20mulighet=20til=20=C3=A5=20loade=20et?= =?UTF-8?q?=20manuellt=20test=20deck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inf112/fiasko/roborally/utility/DeckLoaderUtil.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/inf112/fiasko/roborally/utility/DeckLoaderUtil.java b/src/main/java/inf112/fiasko/roborally/utility/DeckLoaderUtil.java index 1a1f4da..2e7be48 100644 --- a/src/main/java/inf112/fiasko/roborally/utility/DeckLoaderUtil.java +++ b/src/main/java/inf112/fiasko/roborally/utility/DeckLoaderUtil.java @@ -22,8 +22,14 @@ public final class DeckLoaderUtil { * @throws IOException If the programming cards file is invalid */ public static ProgrammingCardDeck loadProgrammingCardsDeck() throws IOException { + return loadCards("programming_cards.txt"); + } + public static ProgrammingCardDeck loadProgrammingCardsTestDeck()throws IOException{ + return loadCards("programming_cards_manuall_testing.txt"); + } + private static ProgrammingCardDeck loadCards(String cardFile) throws IOException{ BufferedReader reader = new BufferedReader(new InputStreamReader( - ResourceUtil.getResourceAsInputStream("programming_cards.txt"))); + ResourceUtil.getResourceAsInputStream(cardFile))); int numberOfCards = Integer.parseInt(reader.readLine()); List programmingCardList = new ArrayList<>(); for (int i = 0; i < numberOfCards; i++) { @@ -34,5 +40,6 @@ public final class DeckLoaderUtil { programmingCardList.add(new ProgrammingCard(cardPriority, cardAction)); } return new ProgrammingCardDeck(programmingCardList); + } }