Fixed .hasType implementation.

This commit is contained in:
magenoxx 2011-08-15 19:26:28 +04:00
parent f488b0268a
commit 291c67ec7d

View file

@ -152,19 +152,19 @@ public abstract class MageObjectImpl<T extends MageObjectImpl<T>> implements Mag
public void adjustCosts(Ability ability, Game game) {} public void adjustCosts(Ability ability, Game game) {}
@Override @Override
public boolean hasSubtype(String subtype) { public boolean hasSubtype(String value) {
if (subtype == null) { if (value == null) {
return false; return false;
} }
if (subtype.contains(subtype)) { if (this.subtype.contains(value)) {
return true; return true;
} }
else { // checking for Changeling else { // checking for Changeling
// first make sure input parameter is not creature type // first make sure input parameter is not creature type
// if so, then ChangelingAbility doesn't matter // if so, then ChangelingAbility doesn't matter
if (subtype.equals("Mountain") || subtype.equals("Island") || subtype.equals("Plains") if (value.equals("Mountain") || value.equals("Island") || value.equals("Plains")
|| subtype.equals("Forest") || subtype.equals("Swamp") || subtype.equals("Aura") || value.equals("Forest") || value.equals("Swamp") || value.equals("Aura")
|| subtype.equals("Equipment") || subtype.equals("Fortification")) { || value.equals("Equipment") || value.equals("Fortification")) {
return false; return false;
} }
// as it is creature subtype, then check the existence of Changeling // as it is creature subtype, then check the existence of Changeling