mirror of
				https://github.com/inf112-v20/Fiasko.git
				synced 2025-11-04 11:43:44 +01:00 
			
		
		
		
	la til mulighet til å loade et manuellt test deck
This commit is contained in:
		@@ -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<ProgrammingCard> 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);
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user