[IKO] Implement Companion and 2 companions

Keruga, the Macrosage and Umori, the Collector
This commit is contained in:
emerald000 2020-04-12 08:23:04 -04:00
parent 395ae9ec11
commit c3684a732b
21 changed files with 866 additions and 128 deletions

View file

@ -49,6 +49,7 @@ public class GameView implements Serializable {
private final List<ExileView> exiles = new ArrayList<>();
private final List<RevealedView> revealed = new ArrayList<>();
private List<LookedAtView> lookedAt = new ArrayList<>();
private final List<RevealedView> companion = new ArrayList<>();
private final List<CombatGroupView> combat = new ArrayList<>();
private final TurnPhase phase;
private final PhaseStep step;
@ -149,6 +150,12 @@ public class GameView implements Serializable {
for (String name : state.getRevealed().keySet()) {
revealed.add(new RevealedView(name, state.getRevealed().get(name), game));
}
for (String name : state.getCompanion().keySet()) {
// Only show the companion window when the companion is still outside the game.
if (state.getCompanion().get(name).stream().anyMatch(cardId -> state.getZone(cardId) == Zone.OUTSIDE)) {
companion.add(new RevealedView(name, state.getCompanion().get(name), game));
}
}
this.phase = state.getTurn().getPhaseType();
this.step = state.getTurn().getStepType();
this.turn = state.getTurnNum();
@ -266,6 +273,10 @@ public class GameView implements Serializable {
return lookedAt;
}
public List<RevealedView> getCompanion() {
return companion;
}
public void setLookedAt(List<LookedAtView> list) {
this.lookedAt = list;
}