From 6ae86a7f7df83dad3d64dd571b4799efaf4a8c74 Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Fri, 7 Dec 2018 19:55:08 -0600 Subject: [PATCH] - refactored Grollub. --- Mage.Sets/src/mage/cards/g/Grollub.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/cards/g/Grollub.java b/Mage.Sets/src/mage/cards/g/Grollub.java index b014a76b8e..45071e13b9 100644 --- a/Mage.Sets/src/mage/cards/g/Grollub.java +++ b/Mage.Sets/src/mage/cards/g/Grollub.java @@ -62,15 +62,12 @@ class EachOpponentGainsLifeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (UUID opponentId : game.getState().getPlayersInRange(source.getControllerId(), game)) { - Player opponent = game.getPlayer(opponentId); - if (opponent != null) { - int amount = (Integer) getValue("damage"); - if (amount > 0) { - opponent.gainLife(amount, game, source); - } + game.getOpponents(source.getControllerId()).stream().map((opponentId) -> game.getPlayer(opponentId)).filter((opponent) -> (opponent != null)).forEachOrdered((opponent) -> { + int amount = (Integer) getValue("damage"); + if (amount > 0) { + opponent.gainLife(amount, game, source); } - } - return false; + }); + return true; } }