mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
[IKO] Implement Companion and 2 companions
Keruga, the Macrosage and Umori, the Collector
This commit is contained in:
parent
395ae9ec11
commit
c3684a732b
21 changed files with 866 additions and 128 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue