mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 04:22:01 -08:00
Implemented Role Reversal
This commit is contained in:
parent
b22443f422
commit
0b703b1be0
4 changed files with 112 additions and 12 deletions
|
|
@ -153,13 +153,18 @@ public interface MageObject extends MageItem, Serializable {
|
|||
* @return
|
||||
*/
|
||||
default boolean shareTypes(Card otherCard) {
|
||||
return this.shareTypes(otherCard, false);
|
||||
}
|
||||
|
||||
default boolean shareTypes(Card otherCard, boolean permanentOnly) {
|
||||
|
||||
if (otherCard == null) {
|
||||
throw new IllegalArgumentException("Params can't be null");
|
||||
}
|
||||
|
||||
for (CardType type : getCardType()) {
|
||||
if (otherCard.getCardType().contains(type)) {
|
||||
if (otherCard.getCardType().contains(type)
|
||||
&& (!permanentOnly || type.isPermanentType())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue