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

Method shuffle

forge-game/src/main/java/forge/game/player/Player.java:1622–1637  ·  view source on GitHub ↗
(final SpellAbility sa)

Source from the content-addressed store, hash-verified

1620 }
1621
1622 public final void shuffle(final SpellAbility sa) {
1623 final CardCollection list = new CardCollection(getCardsIn(ZoneType.Library));
1624
1625 // Note: Shuffling once is sufficient.
1626 Collections.shuffle(list, MyRandom.getRandom());
1627
1628 getZone(ZoneType.Library).setCards(getController().cheatShuffle(list));
1629
1630 // Always Run triggers (701.20e)
1631 final Map<AbilityKey, Object> runParams = AbilityKey.mapFromPlayer(this);
1632 runParams.put(AbilityKey.Source, sa);
1633 game.getTriggerHandler().runTrigger(TriggerType.Shuffled, runParams, false);
1634
1635 // Play the shuffle sound
1636 game.fireEvent(new GameEventShuffle(this));
1637 }
1638
1639 public final Card playLand(final Card land, SpellAbility cause) {
1640 land.setController(this, 0);

Callers 5

prepareAllZonesMethod · 0.95
resolveMethod · 0.95
resolveMethod · 0.95
initVariantsZonesMethod · 0.45

Calls 11

getCardsInMethod · 0.95
getRandomMethod · 0.95
getZoneMethod · 0.95
getControllerMethod · 0.95
mapFromPlayerMethod · 0.95
runTriggerMethod · 0.80
getTriggerHandlerMethod · 0.80
setCardsMethod · 0.45
cheatShuffleMethod · 0.45
putMethod · 0.45
fireEventMethod · 0.45

Tested by

no test coverage detected