1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-10 09:11:04 -09:00

Refactor:Remove unused sourceID param from containsControlled method

This commit is contained in:
DeepCrimson 2022-06-15 21:24:54 -07:00
parent fdcc4e4458
commit 788e42629d
2 changed files with 3 additions and 5 deletions
Mage.Sets/src/mage/cards/r
Mage/src/main/java/mage/game/permanent

View file

@ -79,7 +79,7 @@ class RemorselessPunishmentEffect extends OneShotEffect {
return; return;
} }
} }
if (game.getBattlefield().containsControlled(filter, source.getSourceId(), opponent.getId(), source, game, 1)) { if (game.getBattlefield().containsControlled(filter, opponent.getId(), source, game, 1)) {
if (opponent.chooseUse(outcome, "Choose your " + iteration + " punishment.", null, "Sacrifice a creature or planeswalker", "Lose 5 life", source, game)) { if (opponent.chooseUse(outcome, "Choose your " + iteration + " punishment.", null, "Sacrifice a creature or planeswalker", "Lose 5 life", source, game)) {
TargetPermanent target = new TargetPermanent(1, 1, filter, true); TargetPermanent target = new TargetPermanent(1, 1, filter, true);
if (target.choose(Outcome.Sacrifice, opponent.getId(), source.getId(), source, game)) { if (target.choose(Outcome.Sacrifice, opponent.getId(), source.getId(), source, game)) {

View file

@ -93,7 +93,7 @@ public class Battlefield implements Serializable {
} }
public boolean containsControlled(FilterPermanent filter, Ability source, Game game, int num) { public boolean containsControlled(FilterPermanent filter, Ability source, Game game, int num) {
return containsControlled(filter, source.getSourceId(), source.getControllerId(), source, game, num); return containsControlled(filter, source.getControllerId(), source, game, num);
} }
/** /**
@ -102,21 +102,19 @@ public class Battlefield implements Serializable {
* ignores the range of influence. * ignores the range of influence.
* *
* @param filter * @param filter
* @param sourceId
* @param controllerId controller and source can be different (from different players) * @param controllerId controller and source can be different (from different players)
* @param source * @param source
* @param game * @param game
* @param num * @param num
* @return boolean * @return boolean
*/ */
public boolean containsControlled(FilterPermanent filter, UUID sourceId, UUID controllerId, Ability source, Game game, int num) { public boolean containsControlled(FilterPermanent filter, UUID controllerId, Ability source, Game game, int num) {
return field.values() return field.values()
.stream() .stream()
.filter(permanent -> permanent.isControlledBy(controllerId) .filter(permanent -> permanent.isControlledBy(controllerId)
&& filter.match(permanent, controllerId, source, game) && filter.match(permanent, controllerId, source, game)
&& permanent.isPhasedIn()) && permanent.isPhasedIn())
.count() >= num; .count() >= num;
} }
public boolean contains(FilterPermanent filter, Ability source, Game game, int num) { public boolean contains(FilterPermanent filter, Ability source, Game game, int num) {