mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
SpellAbility: add findSubAbilityByType Helper function
This commit is contained in:
@@ -384,6 +384,17 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
||||
api = apiType;
|
||||
}
|
||||
|
||||
public SpellAbility findSubAbilityByType(ApiType apiType) {
|
||||
SpellAbility sub = this.getSubAbility();
|
||||
while (sub != null) {
|
||||
if (apiType.equals(sub.getApi())) {
|
||||
return sub;
|
||||
}
|
||||
sub = sub.getSubAbility();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public final boolean isCurse() {
|
||||
return hasParam("IsCurse");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user