forked from External/mage
Refactoring
See github line by line comments in 'File changed'
This commit is contained in:
parent
c0cf22bbf7
commit
f04ba151f7
52 changed files with 87 additions and 220 deletions
|
|
@ -49,7 +49,7 @@ import mage.target.TargetAmount;
|
|||
*/
|
||||
public class TargetCreatureOrPlayerAmount extends TargetAmount {
|
||||
|
||||
protected FilterCreatureOrPlayer filter;
|
||||
protected final FilterCreatureOrPlayer filter;
|
||||
|
||||
public TargetCreatureOrPlayerAmount(int amount) {
|
||||
// 107.1c If a rule or ability instructs a player to choose “any number,” that player may choose
|
||||
|
|
@ -84,10 +84,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount {
|
|||
return filter.match(permanent, game);
|
||||
}
|
||||
Player player = game.getPlayer(objectId);
|
||||
if (player != null) {
|
||||
return filter.match(player, game);
|
||||
}
|
||||
return false;
|
||||
return player != null && filter.match(player, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -108,10 +105,7 @@ public class TargetCreatureOrPlayerAmount extends TargetAmount {
|
|||
if (permanent != null) {
|
||||
return filter.match(permanent, game);
|
||||
}
|
||||
if (player != null) {
|
||||
return filter.match(player, game);
|
||||
}
|
||||
return false;
|
||||
return player != null && filter.match(player, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue