forked from External/mage
rewrote enum comparisons, iterator to removeIf, added some stream and filters
This commit is contained in:
parent
05e5ca3c78
commit
3a152ab3d6
41 changed files with 178 additions and 239 deletions
|
|
@ -54,7 +54,7 @@ import mage.game.events.GameEvent;
|
|||
if (this.size() > 0) {
|
||||
for (Iterator<DelayedTriggeredAbility> it = this.iterator();it.hasNext();) {
|
||||
DelayedTriggeredAbility ability = it.next();
|
||||
if (ability.getDuration().equals(Duration.Custom)){
|
||||
if (ability.getDuration()== Duration.Custom){
|
||||
if (ability.isInactive(game)) {
|
||||
it.remove();
|
||||
continue;
|
||||
|
|
@ -74,21 +74,11 @@ import mage.game.events.GameEvent;
|
|||
}
|
||||
|
||||
public void removeEndOfTurnAbilities() {
|
||||
for (Iterator<DelayedTriggeredAbility> it = this.iterator();it.hasNext();) {
|
||||
DelayedTriggeredAbility ability = it.next();
|
||||
if (ability.getDuration() == Duration.EndOfTurn) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
this.removeIf(ability -> ability.getDuration() == Duration.EndOfTurn);
|
||||
}
|
||||
|
||||
public void removeEndOfCombatAbilities() {
|
||||
for (Iterator<DelayedTriggeredAbility> it = this.iterator();it.hasNext();) {
|
||||
DelayedTriggeredAbility ability = it.next();
|
||||
if (ability.getDuration() == Duration.EndOfCombat) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
this.removeIf(ability -> ability.getDuration() == Duration.EndOfCombat);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue