Fix flashback zone to work more like other zones and not crash for desktop game

This commit is contained in:
drdev
2014-10-15 19:53:29 +00:00
parent e9c0e600ec
commit 8aa9fd050e
10 changed files with 32 additions and 71 deletions

View File

@@ -335,6 +335,7 @@ public class CardView extends GameEntityView {
case Exile:
case Battlefield:
case Graveyard:
case Flashback:
case Stack:
//cards in these zones are visible to all
return true;

View File

@@ -1146,6 +1146,9 @@ public class Player extends GameEntity implements Comparable<Player> {
}
return cards;
}
else if (zoneType == ZoneType.Flashback) {
return getCardsActivableInExternalZones(true);
}
PlayerZone zone = getZone(zoneType);
return zone == null ? CardCollection.EMPTY : zone.getCards(filterOutPhasedOut);

View File

@@ -223,6 +223,8 @@ public class PlayerView extends GameEntityView {
return TrackableProperty.Hand;
case Library:
return TrackableProperty.Library;
case Flashback:
return TrackableProperty.Flashback;
default:
return null; //other zones not represented
}
@@ -231,6 +233,17 @@ public class PlayerView extends GameEntityView {
TrackableProperty prop = getZoneProp(zone.getZoneType());
if (prop == null) { return; }
set(prop, CardView.getCollection(zone.getCards()));
//update flashback zone when graveyard, library, or exile zones updated
switch (zone.getZoneType()) {
case Graveyard:
case Library:
case Exile:
set(TrackableProperty.Flashback, CardView.getCollection(zone.getPlayer().getCardsIn(ZoneType.Flashback)));
break;
default:
break;
}
}
public int getMana(final byte color) {

View File

@@ -13,6 +13,7 @@ public enum ZoneType {
Graveyard(false),
Battlefield(false),
Exile(false),
Flashback(false),
Command(false),
Stack(false),
Sideboard(true),