mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
* Author of Shadows - added window with exiled and castable cards;
This commit is contained in:
parent
1d60c2039b
commit
3da525520c
2 changed files with 35 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ public class Exile implements Serializable, Copyable<Exile> {
|
|||
|
||||
private static final UUID PERMANENT = UUID.randomUUID();
|
||||
|
||||
private Map<UUID, ExileZone> exileZones = new HashMap<>();
|
||||
private final Map<UUID, ExileZone> exileZones = new HashMap<>();
|
||||
|
||||
public Exile() {
|
||||
createZone(PERMANENT, "Permanent");
|
||||
|
|
@ -88,6 +88,25 @@ public class Exile implements Serializable, Copyable<Exile> {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move card from one exile zone to another. Use case example: create special zone for exiled and castable card.
|
||||
*
|
||||
* @param card
|
||||
* @param game
|
||||
* @param toZoneId
|
||||
*/
|
||||
public void moveToAnotherZone(Card card, Game game, ExileZone exileZone) {
|
||||
if (getCard(card.getId(), game) == null) {
|
||||
throw new IllegalArgumentException("Card must be in exile zone: " + card.getIdName());
|
||||
}
|
||||
if (exileZone == null) {
|
||||
throw new IllegalArgumentException("Exile zone must exists: " + card.getIdName());
|
||||
}
|
||||
|
||||
removeCard(card, game);
|
||||
exileZone.add(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Exile copy() {
|
||||
return new Exile(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue