MCPcopy Create free account
hub / github.com/Card-Forge/forge / undo

Method undo

forge-game/src/main/java/forge/game/zone/MagicStack.java:195–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193 return undoStackOwner == player;
194 }
195 public final boolean undo() {
196 if (undoStack.isEmpty()) { return false; }
197
198 SpellAbility sa = undoStack.peek();
199 if (sa.undo()) {
200 clearUndoStack(sa);
201 new ManaRefundService(sa).refundManaPaid();
202 } else {
203 clearUndoStack(sa);
204 for (Mana pay : sa.getPayingMana()) {
205 clearUndoStack(pay.getManaAbility().getSourceSA());
206 }
207 }
208 return true;
209 }
210 public final void clearUndoStack(SpellAbility sa) {
211 if (sa == null) {
212 return;

Callers 1

refundManaPaidMethod · 0.45

Calls 8

undoMethod · 0.95
clearUndoStackMethod · 0.95
getPayingManaMethod · 0.95
refundManaPaidMethod · 0.80
getSourceSAMethod · 0.80
getManaAbilityMethod · 0.80
isEmptyMethod · 0.65
peekMethod · 0.45

Tested by

no test coverage detected