Refactoring

See github line by line comments in 'File changed'
This commit is contained in:
vraskulin 2016-12-29 16:49:12 +03:00
parent c0cf22bbf7
commit f04ba151f7
52 changed files with 87 additions and 220 deletions

View file

@ -47,7 +47,7 @@
*/
public class TargetCreatureOrPlaneswalkerAmount extends TargetAmount {
protected FilterCreatureOrPlaneswalkerPermanent filter;
protected final FilterCreatureOrPlaneswalkerPermanent filter;
public TargetCreatureOrPlaneswalkerAmount(int amount) {
// 107.1c If a rule or ability instructs a player to choose any number, that player may choose
@ -85,10 +85,7 @@
@Override
public boolean canTarget(UUID objectId, Game game) {
Permanent permanent = game.getPermanent(objectId);
if (permanent != null) {
return filter.match(permanent, game);
}
return false;
return permanent != null && filter.match(permanent, game);
}
@Override