forked from External/mage
made many dynamicvalues into singleton enums
This commit is contained in:
parent
1d4b0895b4
commit
fd7b8f29ca
390 changed files with 507 additions and 509 deletions
|
|
@ -1,26 +1,26 @@
|
|||
|
||||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public class CardsInAllHandsCount implements DynamicValue {
|
||||
|
||||
public enum CardsInAllHandsCount implements DynamicValue {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
int count = 0;
|
||||
for (UUID playerId : game.getState().getPlayersInRange(sourceAbility.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null)
|
||||
{
|
||||
if (player != null) {
|
||||
count += player.getHand().size();
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ public class CardsInAllHandsCount implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public CardsInAllHandsCount copy() {
|
||||
return new CardsInAllHandsCount();
|
||||
return CardsInAllHandsCount.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue