mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 13:32:06 -08:00
Test framework: added real time card type check (#4936);
This commit is contained in:
parent
bec43e8d31
commit
4c899a25bd
5 changed files with 43 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue