Test framework: added real time card type check (#4936);

This commit is contained in:
Oleg Agafonov 2019-04-22 19:42:25 +04:00
parent bec43e8d31
commit 4c899a25bd
5 changed files with 43 additions and 6 deletions

View file

@ -1,8 +1,3 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.condition.common;
import mage.MageObject;

View file

@ -31,6 +31,16 @@ public enum CardType {
return text;
}
public static CardType fromString(String value) {
for (CardType ct : CardType.values()) {
if (ct.toString().equals(value)) {
return ct;
}
}
throw new IllegalArgumentException("Can't find card type enum value: " + value);
}
public boolean isPermanentType() {
return permanentType;
}

View file

@ -134,7 +134,7 @@ public interface Game extends MageItem, Serializable {
default boolean isActivePlayer(UUID playerId) {
return getActivePlayerId().equals(playerId);
return getActivePlayerId() != null && getActivePlayerId().equals(playerId);
}
/**