Compare commits
5 Commits
82db2bdab1
...
854e2a914b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
854e2a914b | ||
![]() |
bfe865a06e | ||
![]() |
f918e23544 | ||
8313e4ed5b | |||
98dbf5cb74 |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 3.6 MiB |
Before Width: | Height: | Size: 3.3 MiB |
Before Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 3.4 MiB |
BIN
sfx/game_end.mp3
BIN
sfx/game_win.mp3
@ -16,7 +16,7 @@ import eu.jonahbauer.wizard.common.model.Card;
|
|||||||
public class InstructionScreen extends MenuScreen {
|
public class InstructionScreen extends MenuScreen {
|
||||||
private static final int MAX_PAGE = 3;
|
private static final int MAX_PAGE = 3;
|
||||||
|
|
||||||
private TextButton buttonOK;
|
private TextButton buttonBack;
|
||||||
private VerticalGroup content;
|
private VerticalGroup content;
|
||||||
private ScrollPane scrollPane;
|
private ScrollPane scrollPane;
|
||||||
private TextButton nextPageButton;
|
private TextButton nextPageButton;
|
||||||
@ -29,7 +29,7 @@ public class InstructionScreen extends MenuScreen {
|
|||||||
private final ChangeListener listener = new ChangeListener() {
|
private final ChangeListener listener = new ChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void changed(ChangeEvent event, Actor actor) {
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
if (actor == buttonOK) {
|
if (actor == buttonBack) {
|
||||||
game.getClient().execute(Menu.class, Menu::showMenuScreen);
|
game.getClient().execute(Menu.class, Menu::showMenuScreen);
|
||||||
sfxClick();
|
sfxClick();
|
||||||
} else if (actor == nextPageButton) {
|
} else if (actor == nextPageButton) {
|
||||||
@ -70,9 +70,9 @@ public class InstructionScreen extends MenuScreen {
|
|||||||
previousPageButton.addListener(listener);
|
previousPageButton.addListener(listener);
|
||||||
getButtonGroup().addActor(previousPageButton);
|
getButtonGroup().addActor(previousPageButton);
|
||||||
|
|
||||||
buttonOK = new TextButton(messages.get("menu.instruction.back"), skin);
|
buttonBack = new TextButton(messages.get("menu.instruction.back"), skin);
|
||||||
buttonOK.addListener(listener);
|
buttonBack.addListener(listener);
|
||||||
getButtonGroup().addActor(buttonOK);
|
getButtonGroup().addActor(buttonBack);
|
||||||
|
|
||||||
nextPageButton = new TextButton(messages.get("menu.instruction.nextPageButton"), skin);
|
nextPageButton = new TextButton(messages.get("menu.instruction.nextPageButton"), skin);
|
||||||
nextPageButton.addListener(listener);
|
nextPageButton.addListener(listener);
|
||||||
@ -83,7 +83,7 @@ public class InstructionScreen extends MenuScreen {
|
|||||||
scrollPane.setSize(0.65f * WizardGame.WIDTH, 400 + 0.1f * WizardGame.HEIGHT + 80);
|
scrollPane.setSize(0.65f * WizardGame.WIDTH, 400 + 0.1f * WizardGame.HEIGHT + 80);
|
||||||
stage.addActor(scrollPane);
|
stage.addActor(scrollPane);
|
||||||
|
|
||||||
stage.addCaptureListener(new KeyboardFocusManager(scrollPane, previousPageButton, buttonOK, nextPageButton));
|
stage.addCaptureListener(new KeyboardFocusManager(scrollPane, previousPageButton, buttonBack, nextPageButton));
|
||||||
|
|
||||||
showFirstPage();
|
showFirstPage();
|
||||||
}
|
}
|
||||||
@ -166,9 +166,8 @@ public class InstructionScreen extends MenuScreen {
|
|||||||
reset();
|
reset();
|
||||||
|
|
||||||
startSection("menu.instruction.variant.title");
|
startSection("menu.instruction.variant.title");
|
||||||
|
addParagraph("menu.instruction.variant.intro");
|
||||||
|
|
||||||
Label variantsIntro = new Label(messages.get("menu.instruction.variant.intro"), skin);
|
|
||||||
content.addActor(variantsIntro);
|
|
||||||
Table table = new Table(skin).padTop(10);
|
Table table = new Table(skin).padTop(10);
|
||||||
table.defaults().space(10.0f).left().top();
|
table.defaults().space(10.0f).left().top();
|
||||||
table.columnDefaults(1).grow();
|
table.columnDefaults(1).grow();
|
||||||
|
@ -70,6 +70,6 @@ public class CardUtil {
|
|||||||
);
|
);
|
||||||
|
|
||||||
public Card.Suit getDefaultTrumpSuit(Card card) {
|
public Card.Suit getDefaultTrumpSuit(Card card) {
|
||||||
return DEFAULT_SUITES.get(card);
|
return card == null ? Card.Suit.NONE : DEFAULT_SUITES.get(card);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
package eu.jonahbauer.wizard.common.messages.server;
|
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public final class KickVotedMessage extends ServerMessage {
|
|
||||||
/**
|
|
||||||
* UUID of the voting player
|
|
||||||
*/
|
|
||||||
private final @NonNull UUID voter;
|
|
||||||
/**
|
|
||||||
* UUID of player who is supposed to be kicked
|
|
||||||
*/
|
|
||||||
private final @NonNull UUID player;
|
|
||||||
/**
|
|
||||||
* Time until the vote ends in {@link System#currentTimeMillis() UNIX time}
|
|
||||||
*/
|
|
||||||
private final long timeout;
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package eu.jonahbauer.wizard.common.messages.server;
|
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NonNull;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public final class KickedMessage extends ServerMessage {
|
|
||||||
/**
|
|
||||||
* UUID of player who was kicked
|
|
||||||
*/
|
|
||||||
private final @NonNull UUID player;
|
|
||||||
}
|
|
@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public abstract sealed class ServerMessage permits AckMessage, GameMessage, KickVotedMessage, KickedMessage, NackMessage, PlayerLeftMessage, PlayerModifiedMessage, SessionJoinedMessage, SessionListMessage, SessionModifiedMessage, SessionRemovedMessage, StartingGameMessage {
|
public abstract sealed class ServerMessage permits AckMessage, GameMessage, NackMessage, PlayerLeftMessage, PlayerModifiedMessage, SessionJoinedMessage, SessionListMessage, SessionModifiedMessage, SessionRemovedMessage, StartingGameMessage {
|
||||||
private static final ObjectMapper MAPPER = SerializationUtil.newObjectMapper(ServerMessage.class, ObserverMessage.class);
|
private static final ObjectMapper MAPPER = SerializationUtil.newObjectMapper(ServerMessage.class, ObserverMessage.class);
|
||||||
|
|
||||||
public static ServerMessage parse(String json) throws ParseException {
|
public static ServerMessage parse(String json) throws ParseException {
|
||||||
|
@ -1,26 +1,17 @@
|
|||||||
package eu.jonahbauer.wizard.core.machine.states.round;
|
package eu.jonahbauer.wizard.core.machine.states.round;
|
||||||
|
|
||||||
import eu.jonahbauer.wizard.common.messages.observer.TimeoutMessage;
|
|
||||||
import eu.jonahbauer.wizard.common.model.Card;
|
import eu.jonahbauer.wizard.common.model.Card;
|
||||||
import eu.jonahbauer.wizard.core.machine.states.GameData;
|
import eu.jonahbauer.wizard.core.machine.states.GameData;
|
||||||
import eu.jonahbauer.wizard.core.machine.Game;
|
import eu.jonahbauer.wizard.core.machine.Game;
|
||||||
import eu.jonahbauer.wizard.common.messages.observer.HandMessage;
|
|
||||||
import eu.jonahbauer.wizard.common.messages.observer.TrumpMessage;
|
import eu.jonahbauer.wizard.common.messages.observer.TrumpMessage;
|
||||||
import eu.jonahbauer.wizard.common.messages.observer.UserInputMessage;
|
|
||||||
import eu.jonahbauer.wizard.common.messages.player.PickTrumpMessage;
|
|
||||||
import eu.jonahbauer.wizard.common.messages.player.PlayerMessage;
|
|
||||||
import eu.jonahbauer.wizard.core.machine.GameState;
|
import eu.jonahbauer.wizard.core.machine.GameState;
|
||||||
import eu.jonahbauer.wizard.core.model.card.GameCards;
|
import eu.jonahbauer.wizard.core.model.card.GameCards;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static eu.jonahbauer.wizard.core.machine.states.GameData.*;
|
import static eu.jonahbauer.wizard.core.machine.states.GameData.*;
|
||||||
import static eu.jonahbauer.wizard.common.messages.observer.UserInputMessage.Action.PICK_TRUMP;
|
|
||||||
|
|
||||||
public final class DeterminingTrump extends RoundState {
|
public final class DeterminingTrump extends RoundState {
|
||||||
private transient UUID player;
|
|
||||||
private transient boolean werewolf;
|
|
||||||
|
|
||||||
public DeterminingTrump(GameData data) {
|
public DeterminingTrump(GameData data) {
|
||||||
super(data.require(TRUMP_CARD).requireEach(PLAYERS, HANDS));
|
super(data.require(TRUMP_CARD).requireEach(PLAYERS, HANDS));
|
||||||
@ -35,74 +26,31 @@ public final class DeterminingTrump extends RoundState {
|
|||||||
var player = entry.getKey();
|
var player = entry.getKey();
|
||||||
var hand = entry.getValue();
|
var hand = entry.getValue();
|
||||||
if (hand.contains(Card.WEREWOLF)) {
|
if (hand.contains(Card.WEREWOLF)) {
|
||||||
this.player = player;
|
|
||||||
this.werewolf = true;
|
|
||||||
game.notify(new TrumpMessage(trumpCard, null));
|
game.notify(new TrumpMessage(trumpCard, null));
|
||||||
game.notify(new TrumpMessage(Card.WEREWOLF, null));
|
game.notify(new TrumpMessage(Card.WEREWOLF, null));
|
||||||
game.notify(new UserInputMessage(this.player, PICK_TRUMP, getTimeout(game, true)));
|
|
||||||
return timeout(game);
|
var data = getData().with(CURRENT_PLAYER, player);
|
||||||
|
return sync(data, DeterminingTrumpUserInput::new);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// default trump handling
|
// default trump handling
|
||||||
Card.Suit trumpSuit = trumpCard != null ? GameCards.get(trumpCard).getTrumpSuit() : Card.Suit.NONE;
|
Card.Suit trumpSuit = trumpCard != null ? GameCards.get(trumpCard).getTrumpSuit() : Card.Suit.NONE;
|
||||||
if (trumpSuit == null) {
|
if (trumpSuit == null) {
|
||||||
this.player = getDealer();
|
var player = getDealer();
|
||||||
game.notify(new TrumpMessage(trumpCard, null));
|
game.notify(new TrumpMessage(trumpCard, null));
|
||||||
game.notify(new UserInputMessage(this.player, PICK_TRUMP, getTimeout(game, true)));
|
|
||||||
return timeout(game);
|
var data = getData().with(CURRENT_PLAYER, player);
|
||||||
|
return sync(data, DeterminingTrumpUserInput::new);
|
||||||
} else {
|
} else {
|
||||||
return transition(game, trumpSuit);
|
var data = getData().with(
|
||||||
}
|
TRUMP_SUIT, trumpSuit,
|
||||||
}
|
CURRENT_PLAYER, getNextPlayer(getDealer())
|
||||||
|
);
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<GameState> onTimeout(Game game) {
|
|
||||||
game.notify(new TimeoutMessage());
|
|
||||||
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};
|
|
||||||
}
|
|
||||||
return transition(game, suits[game.getRandom().nextInt(suits.length)]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<GameState> onMessage(Game game, UUID player, PlayerMessage message) {
|
|
||||||
if (this.player.equals(player) && message instanceof PickTrumpMessage trumpMessage) {
|
|
||||||
checkTrumpSuit(trumpMessage.getTrumpSuit());
|
|
||||||
return transition(game, trumpMessage.getTrumpSuit());
|
|
||||||
} else {
|
|
||||||
return super.onMessage(game, player, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void checkTrumpSuit(Card.Suit suit) {
|
|
||||||
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.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<GameState> transition(Game game, @NotNull Card.Suit trumpSuit) {
|
|
||||||
GameData data = getData().with(
|
|
||||||
TRUMP_SUIT, trumpSuit,
|
|
||||||
CURRENT_PLAYER, getNextPlayer(getDealer())
|
|
||||||
);
|
|
||||||
|
|
||||||
if (werewolf) {
|
|
||||||
var mutableHands = new HashMap<>(get(HANDS));
|
|
||||||
var mutableHand = new ArrayList<>(mutableHands.get(player));
|
|
||||||
mutableHand.set(mutableHand.indexOf(Card.WEREWOLF), get(TRUMP_CARD));
|
|
||||||
mutableHands.put(player, List.copyOf(mutableHand));
|
|
||||||
data = data.with(HANDS, Map.copyOf(mutableHands));
|
|
||||||
game.notify(new TrumpMessage(Card.WEREWOLF, trumpSuit));
|
|
||||||
game.notify(player, new HandMessage(player, mutableHands.get(player)));
|
|
||||||
} else {
|
|
||||||
game.notify(new TrumpMessage(get(TRUMP_CARD), trumpSuit));
|
game.notify(new TrumpMessage(get(TRUMP_CARD), trumpSuit));
|
||||||
|
|
||||||
|
return sync(data, Predicting::new);
|
||||||
}
|
}
|
||||||
return sync(data, Predicting::new);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,89 @@
|
|||||||
|
package eu.jonahbauer.wizard.core.machine.states.round;
|
||||||
|
|
||||||
|
import eu.jonahbauer.wizard.common.messages.observer.HandMessage;
|
||||||
|
import eu.jonahbauer.wizard.common.messages.observer.TimeoutMessage;
|
||||||
|
import eu.jonahbauer.wizard.common.messages.observer.TrumpMessage;
|
||||||
|
import eu.jonahbauer.wizard.common.messages.observer.UserInputMessage;
|
||||||
|
import eu.jonahbauer.wizard.common.messages.player.PickTrumpMessage;
|
||||||
|
import eu.jonahbauer.wizard.common.messages.player.PlayerMessage;
|
||||||
|
import eu.jonahbauer.wizard.common.model.Card;
|
||||||
|
import eu.jonahbauer.wizard.core.machine.Game;
|
||||||
|
import eu.jonahbauer.wizard.core.machine.GameState;
|
||||||
|
import eu.jonahbauer.wizard.core.machine.states.GameData;
|
||||||
|
import eu.jonahbauer.wizard.core.machine.states.TransientState;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static eu.jonahbauer.wizard.common.messages.observer.UserInputMessage.Action.PICK_TRUMP;
|
||||||
|
import static eu.jonahbauer.wizard.core.machine.states.GameData.*;
|
||||||
|
import static eu.jonahbauer.wizard.core.machine.states.GameData.TRUMP_CARD;
|
||||||
|
|
||||||
|
public final class DeterminingTrumpUserInput extends RoundState implements TransientState {
|
||||||
|
private final transient UUID player;
|
||||||
|
private final transient boolean werewolf;
|
||||||
|
|
||||||
|
public DeterminingTrumpUserInput(GameData data) {
|
||||||
|
super(data.require(TRUMP_CARD).requireEach(PLAYERS, HANDS).require(CURRENT_PLAYER));
|
||||||
|
|
||||||
|
this.player = get(CURRENT_PLAYER);
|
||||||
|
this.werewolf = get(HANDS).get(this.player).contains(Card.WEREWOLF);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<GameState> onEnter(Game game) {
|
||||||
|
game.notify(new UserInputMessage(this.player, PICK_TRUMP, getTimeout(game, true)));
|
||||||
|
return timeout(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<GameState> onTimeout(Game game) {
|
||||||
|
game.notify(new TimeoutMessage());
|
||||||
|
|
||||||
|
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};
|
||||||
|
}
|
||||||
|
return transition(game, suits[game.getRandom().nextInt(suits.length)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<GameState> onMessage(Game game, UUID player, PlayerMessage message) {
|
||||||
|
if (this.player.equals(player) && message instanceof PickTrumpMessage trumpMessage) {
|
||||||
|
checkTrumpSuit(trumpMessage.getTrumpSuit());
|
||||||
|
return transition(game, trumpMessage.getTrumpSuit());
|
||||||
|
} else {
|
||||||
|
return super.onMessage(game, player, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkTrumpSuit(Card.Suit suit) {
|
||||||
|
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.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Optional<GameState> transition(Game game, @NotNull Card.Suit trumpSuit) {
|
||||||
|
GameData data = getData().with(
|
||||||
|
TRUMP_SUIT, trumpSuit,
|
||||||
|
CURRENT_PLAYER, getNextPlayer(getDealer())
|
||||||
|
);
|
||||||
|
|
||||||
|
if (werewolf) {
|
||||||
|
var mutableHands = new HashMap<>(get(HANDS));
|
||||||
|
var mutableHand = new ArrayList<>(mutableHands.get(player));
|
||||||
|
mutableHand.set(mutableHand.indexOf(Card.WEREWOLF), get(TRUMP_CARD));
|
||||||
|
mutableHands.put(player, List.copyOf(mutableHand));
|
||||||
|
data = data.with(HANDS, Map.copyOf(mutableHands));
|
||||||
|
game.notify(new TrumpMessage(Card.WEREWOLF, trumpSuit));
|
||||||
|
game.notify(player, new HandMessage(player, mutableHands.get(player)));
|
||||||
|
} else {
|
||||||
|
game.notify(new TrumpMessage(get(TRUMP_CARD), trumpSuit));
|
||||||
|
}
|
||||||
|
return sync(data, Predicting::new);
|
||||||
|
}
|
||||||
|
}
|
@ -38,7 +38,7 @@ public class DeterminingTrumpTest {
|
|||||||
@SuppressWarnings("SameParameterValue")
|
@SuppressWarnings("SameParameterValue")
|
||||||
private Game performTest(GameConfiguration configuration, int round, Map<UUID, List<Card>> hands, Card trumpCard, MessageQueue queue) {
|
private Game performTest(GameConfiguration configuration, int round, Map<UUID, List<Card>> hands, Card trumpCard, MessageQueue queue) {
|
||||||
Game game = spy(new Game(configuration, queue));
|
Game game = spy(new Game(configuration, queue));
|
||||||
doFinish().when(game).transition(any(SyncState.class));
|
doFinish().when(game).transition(argThat(argument -> argument instanceof SyncState && argument.getData().has(TRUMP_SUIT)));
|
||||||
queue.setGame(game);
|
queue.setGame(game);
|
||||||
|
|
||||||
var playerList = List.of(players);
|
var playerList = List.of(players);
|
||||||
@ -92,7 +92,8 @@ public class DeterminingTrumpTest {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// play cards in given order
|
// play cards in given order
|
||||||
MessageQueue queue = new MessageQueue();
|
MessageQueue queue = new MessageQueue()
|
||||||
|
.sync(players);
|
||||||
|
|
||||||
Game game = performTest(Configurations.ANNIVERSARY_2021, 0, hands, Card.GREEN_JESTER, queue);
|
Game game = performTest(Configurations.ANNIVERSARY_2021, 0, hands, Card.GREEN_JESTER, queue);
|
||||||
|
|
||||||
@ -117,6 +118,7 @@ public class DeterminingTrumpTest {
|
|||||||
|
|
||||||
// play cards in given order
|
// play cards in given order
|
||||||
MessageQueue queue = new MessageQueue()
|
MessageQueue queue = new MessageQueue()
|
||||||
|
.sync(players)
|
||||||
.addPickTrump(players[0], Card.Suit.GREEN);
|
.addPickTrump(players[0], Card.Suit.GREEN);
|
||||||
|
|
||||||
Game game = performTest(Configurations.ANNIVERSARY_2021, 0, hands, Card.BLUE_WIZARD, queue);
|
Game game = performTest(Configurations.ANNIVERSARY_2021, 0, hands, Card.BLUE_WIZARD, queue);
|
||||||
@ -144,6 +146,7 @@ public class DeterminingTrumpTest {
|
|||||||
|
|
||||||
// play cards in given order
|
// play cards in given order
|
||||||
MessageQueue queue = new MessageQueue()
|
MessageQueue queue = new MessageQueue()
|
||||||
|
.sync(players)
|
||||||
.addPickTrump(players[3], Card.Suit.YELLOW);
|
.addPickTrump(players[3], Card.Suit.YELLOW);
|
||||||
|
|
||||||
Game game = performTest(Configurations.ANNIVERSARY_2021, 0, hands, Card.GREEN_1, queue);
|
Game game = performTest(Configurations.ANNIVERSARY_2021, 0, hands, Card.GREEN_1, queue);
|
||||||
|
@ -148,10 +148,11 @@ public class RoundTest {
|
|||||||
@Test
|
@Test
|
||||||
public void run_Anniversary() throws ExecutionException, InterruptedException {
|
public void run_Anniversary() throws ExecutionException, InterruptedException {
|
||||||
MessageQueue queue = new MessageQueue()
|
MessageQueue queue = new MessageQueue()
|
||||||
.sync(players)
|
.sync(players) // starting_round
|
||||||
.sync(players)
|
.sync(players) // dealing
|
||||||
|
.sync(players) // determining_trump
|
||||||
.addPickTrump(players[2], Card.Suit.YELLOW)
|
.addPickTrump(players[2], Card.Suit.YELLOW)
|
||||||
.sync(players)
|
.sync(players) // determining_trump
|
||||||
.addPrediction(players[3], 2)
|
.addPrediction(players[3], 2)
|
||||||
.addPrediction(players[0], 2)
|
.addPrediction(players[0], 2)
|
||||||
.addPrediction(players[1], 2)
|
.addPrediction(players[1], 2)
|
||||||
|