mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Fix flashback zone to work more like other zones and not crash for desktop game
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -13,6 +13,7 @@ public enum ZoneType {
|
||||
Graveyard(false),
|
||||
Battlefield(false),
|
||||
Exile(false),
|
||||
Flashback(false),
|
||||
Command(false),
|
||||
Stack(false),
|
||||
Sideboard(true),
|
||||
|
||||
Reference in New Issue
Block a user