forked from External/mage
Sword of War and Peace
This commit is contained in:
parent
fb80e6df45
commit
94b3802c0a
2 changed files with 179 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
package mage.abilities.dynamicvalue.common;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
public class CardsInControlledPlayerHandCount implements DynamicValue {
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility) {
|
||||
Player controller = game.getPlayer(sourceAbility.getControllerId());
|
||||
if (controller != null) {
|
||||
return controller.getHand().size();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue clone() {
|
||||
return new CardsInControlledPlayerHandCount();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue