Skip to content

Commit

Permalink
fix checkstyle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexciornei22 committed Nov 24, 2022
1 parent 4732c4a commit 848bdff
Show file tree
Hide file tree
Showing 43 changed files with 510 additions and 740 deletions.
431 changes: 22 additions & 409 deletions checkstyle.txt

Large diffs are not rendered by default.

30 changes: 13 additions & 17 deletions src/main/Deck.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main;

import fileio.CardInput;
import fileio.DecksInput;
import main.card.Card;
import main.card.EnvironmentCard;
import main.card.MinionCard;
Expand All @@ -11,22 +10,23 @@

import java.util.ArrayList;

public class Deck {
ArrayList<Card> cards = new ArrayList<>();
public final class Deck {
private final ArrayList<Card> cards = new ArrayList<>();

public Deck(ArrayList<CardInput> deckInput) {
public Deck(final ArrayList<CardInput> deckInput) {
deckInput.forEach(cardInput -> {
if (Game.ENVIRONMENT_CARDS.contains(cardInput.getName())) {
switch (cardInput.getName()) {
case "Firestorm":
cards.add(new EnvironmentCard(cardInput, new Firestorm()));
break;
case "Winterfell":
cards.add(new EnvironmentCard(cardInput, new Winterfell()));
break;
case "Heart Hound":
cards.add(new EnvironmentCard(cardInput, new HeartHound()));
break;
case "Firestorm" -> cards.add(
new EnvironmentCard(cardInput, new Firestorm())
);
case "Winterfell" -> cards.add(
new EnvironmentCard(cardInput, new Winterfell())
);
case "Heart Hound" -> cards.add(
new EnvironmentCard(cardInput, new HeartHound())
);
default -> { }
}
} else {
cards.add(new MinionCard(cardInput));
Expand All @@ -37,8 +37,4 @@ public Deck(ArrayList<CardInput> deckInput) {
public ArrayList<Card> getCards() {
return cards;
}

public void setCards(ArrayList<Card> cards) {
this.cards = cards;
}
}
Loading

0 comments on commit 848bdff

Please sign in to comment.