|
|
|
@ -57,7 +57,12 @@ public final class DeterminingTrump extends RoundState {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onTimeout(Game game) {
|
|
|
|
|
Card.Suit[] suits = new Card.Suit[]{Card.Suit.BLUE, Card.Suit.GREEN, Card.Suit.RED, Card.Suit.YELLOW};
|
|
|
|
|
Card.Suit[] suits;
|
|
|
|
|
if (werewolf) {
|
|
|
|
|
suits = new Card.Suit[]{Card.Suit.BLUE, Card.Suit.GREEN, Card.Suit.RED, Card.Suit.YELLOW, Card.Suit.NONE};
|
|
|
|
|
} else {
|
|
|
|
|
suits = new Card.Suit[]{Card.Suit.BLUE, Card.Suit.GREEN, Card.Suit.RED, Card.Suit.YELLOW};
|
|
|
|
|
}
|
|
|
|
|
transition(game, suits[game.getRandom().nextInt(suits.length)]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -72,8 +77,10 @@ public final class DeterminingTrump extends RoundState {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkTrumpSuit(Card.Suit suit) {
|
|
|
|
|
if (suit == Card.Suit.NONE) {
|
|
|
|
|
if (!werewolf && suit == Card.Suit.NONE) {
|
|
|
|
|
throw new IllegalArgumentException("Trump suit must not be " + Card.Suit.NONE + ".");
|
|
|
|
|
} else if (suit == null) {
|
|
|
|
|
throw new IllegalArgumentException("Trump suit must not be null.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|