mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Merge pull request #9116 from DeepCrimson/removeUnusedParamFromContainsControlled
Refactor: Remove unused sourceID param from `containsControlled` method
This commit is contained in:
commit
6bf9f45cd5
2 changed files with 3 additions and 5 deletions
|
@ -79,7 +79,7 @@ class RemorselessPunishmentEffect extends OneShotEffect {
|
|||
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)) {
|
||||
TargetPermanent target = new TargetPermanent(1, 1, filter, true);
|
||||
if (target.choose(Outcome.Sacrifice, opponent.getId(), source.getId(), source, game)) {
|
||||
|
|
|
@ -93,7 +93,7 @@ public class Battlefield implements Serializable {
|
|||
}
|
||||
|
||||
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.
|
||||
*
|
||||
* @param filter
|
||||
* @param sourceId
|
||||
* @param controllerId controller and source can be different (from different players)
|
||||
* @param source
|
||||
* @param game
|
||||
* @param num
|
||||
* @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()
|
||||
.stream()
|
||||
.filter(permanent -> permanent.isControlledBy(controllerId)
|
||||
&& filter.match(permanent, controllerId, source, game)
|
||||
&& permanent.isPhasedIn())
|
||||
.count() >= num;
|
||||
|
||||
}
|
||||
|
||||
public boolean contains(FilterPermanent filter, Ability source, Game game, int num) {
|
||||
|
|
Loading…
Reference in a new issue