mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Little improves for tests
This commit is contained in:
parent
e73a11cb12
commit
329f7fd609
5 changed files with 15 additions and 14 deletions
|
|
@ -223,14 +223,20 @@ public class ContinuousEffectsList<T extends ContinuousEffect> extends ArrayList
|
|||
effectAbilityMap.clear();
|
||||
}
|
||||
|
||||
public boolean contains(Effect effect) {
|
||||
@Override
|
||||
public boolean contains(Object object) {
|
||||
if (object == null || !(object instanceof ContinuousEffect)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// search by id
|
||||
ContinuousEffect need = (ContinuousEffect) object;
|
||||
for (Iterator<T> iterator = this.iterator(); iterator.hasNext(); ) {
|
||||
T test = iterator.next();
|
||||
if (effect.getId().equals(test.getId())) {
|
||||
if (need.equals(test)) {
|
||||
return true;
|
||||
}
|
||||
if (effect.equals(test)) {
|
||||
if (need.getId().equals(test.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue