forked from External/mage
* Added missing changes to commit 06eaa5ab99.
This commit is contained in:
parent
5cc9e22bd5
commit
7ae6054c1e
4 changed files with 25 additions and 1 deletions
|
|
@ -51,7 +51,7 @@ import mage.game.Game;
|
|||
public class Commander implements CommandObject{
|
||||
|
||||
private final Card card;
|
||||
private final Abilities<Ability> abilites = new AbilitiesImpl<Ability>();
|
||||
private final Abilities<Ability> abilites = new AbilitiesImpl<>();
|
||||
|
||||
|
||||
public Commander(Card card){
|
||||
|
|
@ -128,6 +128,15 @@ public class Commander implements CommandObject{
|
|||
return abilites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAbility(UUID abilityId, Game game) {
|
||||
if (this.getAbilities().containsKey(abilityId)) {
|
||||
return true;
|
||||
}
|
||||
Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(getId());
|
||||
return otherAbilities != null && otherAbilities.containsKey(abilityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
return card.getColor();
|
||||
|
|
|
|||
|
|
@ -132,6 +132,11 @@ public class Emblem implements CommandObject {
|
|||
return abilites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAbility(UUID abilityId, Game game) {
|
||||
return abilites.containsKey(abilityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
return emptyColor;
|
||||
|
|
|
|||
|
|
@ -565,6 +565,11 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
|||
return card.getAbilities();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAbility(UUID abilityId, Game game) {
|
||||
return card.hasAbility(abilityId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
return card.getColor();
|
||||
|
|
|
|||
|
|
@ -146,6 +146,11 @@ public class StackAbility implements StackObject, Ability {
|
|||
return emptyAbilites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAbility(UUID abilityId, Game game) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectColor getColor() {
|
||||
return emptyColor;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue