Ballon is not a typo

This commit is contained in:
Arne Keller 2020-03-03 18:42:59 +01:00
parent e13ee8430f
commit 0c9ea4e0ba
2 changed files with 8 additions and 8 deletions

View File

@ -20,7 +20,7 @@ import static edu.kit.informatik.model.Card.THUNDERSTORM;
import static edu.kit.informatik.model.Card.TIGER; import static edu.kit.informatik.model.Card.TIGER;
import static edu.kit.informatik.model.Card.WOOD; import static edu.kit.informatik.model.Card.WOOD;
import static edu.kit.informatik.model.Item.AXE; import static edu.kit.informatik.model.Item.AXE;
import static edu.kit.informatik.model.Item.BALLOON; import static edu.kit.informatik.model.Item.BALLON;
import static edu.kit.informatik.model.Item.CLUB; import static edu.kit.informatik.model.Item.CLUB;
import static edu.kit.informatik.model.Item.FIREPLACE; import static edu.kit.informatik.model.Item.FIREPLACE;
import static edu.kit.informatik.model.Item.HANG_GLIDER; import static edu.kit.informatik.model.Item.HANG_GLIDER;
@ -133,7 +133,7 @@ public class CardGame {
resources.removeLastOccurrence(resource); resources.removeLastOccurrence(resource);
} }
items.add(item); items.add(item);
if (item.equals(STEAMBOAT) || item.equals(BALLOON)) { if (item.equals(STEAMBOAT) || item.equals(BALLON)) {
// player won // player won
endGame(); endGame();
return "win"; return "win";

View File

@ -12,7 +12,7 @@ public enum Item {
SAILING_RAFT, SAILING_RAFT,
HANG_GLIDER, HANG_GLIDER,
STEAMBOAT, STEAMBOAT,
BALLOON; BALLON;
public Card[] resourcesNeeded() { public Card[] resourcesNeeded() {
switch (this) { switch (this) {
@ -30,7 +30,7 @@ public enum Item {
return new Card[] {WOOD, WOOD, METAL, METAL, PLASTIC, PLASTIC, PLASTIC, PLASTIC}; return new Card[] {WOOD, WOOD, METAL, METAL, PLASTIC, PLASTIC, PLASTIC, PLASTIC};
case STEAMBOAT: case STEAMBOAT:
return new Card[] {METAL, METAL, METAL, METAL, METAL, METAL, PLASTIC}; return new Card[] {METAL, METAL, METAL, METAL, METAL, METAL, PLASTIC};
case BALLOON: case BALLON:
return new Card[] {WOOD, PLASTIC, PLASTIC, PLASTIC, PLASTIC, PLASTIC, PLASTIC}; return new Card[] {WOOD, PLASTIC, PLASTIC, PLASTIC, PLASTIC, PLASTIC, PLASTIC};
default: // we don't have any such items, but could add some eventually default: // we don't have any such items, but could add some eventually
throw new IllegalArgumentException("item does not need resources"); throw new IllegalArgumentException("item does not need resources");
@ -38,7 +38,7 @@ public enum Item {
} }
public boolean requiresFireplace() { public boolean requiresFireplace() {
return this.equals(STEAMBOAT) || this.equals(BALLOON); return this.equals(STEAMBOAT) || this.equals(BALLON);
} }
public boolean canHaveMoreThanOne() { public boolean canHaveMoreThanOne() {
@ -62,7 +62,7 @@ public enum Item {
case "steamboat": case "steamboat":
return STEAMBOAT; return STEAMBOAT;
case "ballon": case "ballon":
return BALLOON; return BALLON;
default: default:
return null; return null;
} }
@ -85,8 +85,8 @@ public enum Item {
return "hangglider"; return "hangglider";
case STEAMBOAT: case STEAMBOAT:
return "steamboat"; return "steamboat";
case BALLOON: case BALLON:
return "ballon"; // lol, a type in the specification! return "ballon";
default: default:
return null; return null;
} }