Skip to content

Commit

Permalink
Getting closer
Browse files Browse the repository at this point in the history
  • Loading branch information
Howie authored May 25, 2020
1 parent 9a9cb50 commit 6dd55ff
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/hs_generator/CardBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public CardBuilder() {
}

// Generates a new blank card with a randomly assigned mana cost
private Card newCard() {
public Card newCard() {
Card newCard = new Card();
newCard.setMana(rng.nextInt(10) + 1);
newCard.setType(this.randomType());
Expand Down Expand Up @@ -98,7 +98,7 @@ private Conditional selectConditional(){
}

// Parse a hs_generator.Card object in such a way that it can be read in the console
private static String parseToPrint(Card card) {
public String toString(Card card) {
return ("Mana: " + card.getMana() + " Attack: " + card.getAttack() + " Health: " + card.getHealth() +
" Type: " + card.getType().toString().substring(0, 1).toUpperCase() +
card.getType().toString().substring(1).toLowerCase() + " Description: " + card.getText());
Expand Down Expand Up @@ -299,7 +299,7 @@ private void addConditional(Card card, boolean battlecry) {
}


private Card makeBattlecryCard() {
public Card makeBattlecryCard() {
Card card = this.newCard(); // Make a new card
this.addKeyword(card);
card.addToText("Battlecry: "); // Write the boilerplate
Expand All @@ -313,7 +313,7 @@ private Card makeBattlecryCard() {
return card;
}

private Card makeDeathrattleCard() {
public Card makeDeathrattleCard() {
Card card = this.newCard(); // Make a new card
card.spendBudget(-1); // Deathrattles generally seem to be weaker
this.addKeyword(card);
Expand Down Expand Up @@ -354,25 +354,25 @@ public static void main(String[] args) throws IOException {
switch (cardType) {
case "1":
for (int i = 0; i < Integer.parseInt(cardCount); i++) {
System.out.println(parseToPrint(cb.makeVanillaCard()));
System.out.println(cb.toString(cb.makeVanillaCard()));
}
accepted = true;
break;
case "2":
for (int i = 0; i < Integer.parseInt(cardCount); i++) {
System.out.println(parseToPrint(cb.makeBattlecryCard()));
System.out.println(cb.toString(cb.makeBattlecryCard()));
}
accepted = true;
break;
case "3":
for (int i = 0; i < Integer.parseInt(cardCount); i++) {
System.out.println(parseToPrint(cb.makeDeathrattleCard()));
System.out.println(cb.toString(cb.makeDeathrattleCard()));
}
accepted = true;
break;
case "4":
for (int i = 0; i < Integer.parseInt(cardCount); i++) {
System.out.println(parseToPrint(cb.makeEndTurnCard()));
System.out.println(cb.toString(cb.makeEndTurnCard()));
}
accepted = true;
break;
Expand Down

0 comments on commit 6dd55ff

Please sign in to comment.