From 5a2ca77a3f3d36dc95e9cb7774c3b00017379554 Mon Sep 17 00:00:00 2001 From: melvin Date: Sat, 26 Oct 2013 09:56:13 +0800 Subject: [PATCH] added HasSubType and NotSubType factory method --- .../model/condition/MagicConditionFactory.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/magic/model/condition/MagicConditionFactory.java b/src/magic/model/condition/MagicConditionFactory.java index bbea2a36b1..c185c95b8c 100644 --- a/src/magic/model/condition/MagicConditionFactory.java +++ b/src/magic/model/condition/MagicConditionFactory.java @@ -55,6 +55,22 @@ public class MagicConditionFactory { } }; } + + public static MagicCondition HasSubType(final MagicSubType subtype) { + return new MagicCondition() { + public boolean accept(final MagicSource source) { + return source.hasSubType(subtype); + } + }; + } + + public static MagicCondition NotSubType(final MagicSubType subtype) { + return new MagicCondition() { + public boolean accept(final MagicSource source) { + return source.hasSubType(subtype) == false; + } + }; + } public static MagicCondition HandAtLeast(final int n) { return new MagicCondition() {