mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Merge pull request #8792 from kevlahnota/master4
add breadcrumb to GameAction moveTo
This commit is contained in:
@@ -57,6 +57,8 @@ import forge.item.PaperCard;
|
|||||||
import forge.util.*;
|
import forge.util.*;
|
||||||
import forge.util.collect.FCollection;
|
import forge.util.collect.FCollection;
|
||||||
import forge.util.collect.FCollectionView;
|
import forge.util.collect.FCollectionView;
|
||||||
|
import io.sentry.Breadcrumb;
|
||||||
|
import io.sentry.Sentry;
|
||||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||||
import org.jgrapht.alg.cycle.SzwarcfiterLauerSimpleCycles;
|
import org.jgrapht.alg.cycle.SzwarcfiterLauerSimpleCycles;
|
||||||
import org.jgrapht.graph.DefaultDirectedGraph;
|
import org.jgrapht.graph.DefaultDirectedGraph;
|
||||||
@@ -749,26 +751,29 @@ public class GameAction {
|
|||||||
|
|
||||||
public final Card moveTo(final ZoneType name, final Card c, final int libPosition, SpellAbility cause, Map<AbilityKey, Object> params) {
|
public final Card moveTo(final ZoneType name, final Card c, final int libPosition, SpellAbility cause, Map<AbilityKey, Object> params) {
|
||||||
// Call specific functions to set PlayerZone, then move onto moveTo
|
// Call specific functions to set PlayerZone, then move onto moveTo
|
||||||
switch(name) {
|
try {
|
||||||
case Hand: return moveToHand(c, cause, params);
|
return switch (name) {
|
||||||
case Library: return moveToLibrary(c, libPosition, cause, params);
|
case Hand -> moveToHand(c, cause, params);
|
||||||
case Battlefield: return moveToPlay(c, c.getController(), cause, params);
|
case Library -> moveToLibrary(c, libPosition, cause, params);
|
||||||
case Graveyard: return moveToGraveyard(c, cause, params);
|
case Battlefield -> moveToPlay(c, c.getController(), cause, params);
|
||||||
case Exile:
|
case Graveyard -> moveToGraveyard(c, cause, params);
|
||||||
if (!c.canExiledBy(cause, true)) {
|
case Exile -> !c.canExiledBy(cause, true) ? null : exile(c, cause, params);
|
||||||
return null;
|
case Stack -> moveToStack(c, cause, params);
|
||||||
}
|
case PlanarDeck, SchemeDeck, AttractionDeck, ContraptionDeck -> moveToVariantDeck(c, name, libPosition, cause, params);
|
||||||
return exile(c, cause, params);
|
case Junkyard -> moveToJunkyard(c, cause, params);
|
||||||
case Stack: return moveToStack(c, cause, params);
|
default -> moveTo(c.getOwner().getZone(name), c, cause); // sideboard will also get there
|
||||||
case PlanarDeck:
|
};
|
||||||
case SchemeDeck:
|
} catch (Exception e) {
|
||||||
case AttractionDeck:
|
String msg = "GameAction:moveTo: Exception occured";
|
||||||
case ContraptionDeck:
|
|
||||||
return moveToVariantDeck(c, name, libPosition, cause, params);
|
Breadcrumb bread = new Breadcrumb(msg);
|
||||||
case Junkyard:
|
bread.setData("Card", c.getName());
|
||||||
return moveToJunkyard(c, cause, params);
|
bread.setData("SA", cause.toString());
|
||||||
default: // sideboard will also get there
|
bread.setData("ZoneType", name.name());
|
||||||
return moveTo(c.getOwner().getZone(name), c, cause);
|
bread.setData("Player", c.getOwner());
|
||||||
|
Sentry.addBreadcrumb(bread);
|
||||||
|
|
||||||
|
throw new RuntimeException("Error in GameAction moveTo " + c.getName() + " to Player Zone " + name.name(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user