From 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Sun, 18 Oct 2015 23:04:39 -0400 Subject: Move source directory --- main/java/gregtech/api/interfaces/ICondition.java | 104 ---------------------- 1 file changed, 104 deletions(-) delete mode 100644 main/java/gregtech/api/interfaces/ICondition.java (limited to 'main/java/gregtech/api/interfaces/ICondition.java') diff --git a/main/java/gregtech/api/interfaces/ICondition.java b/main/java/gregtech/api/interfaces/ICondition.java deleted file mode 100644 index 507315ee91..0000000000 --- a/main/java/gregtech/api/interfaces/ICondition.java +++ /dev/null @@ -1,104 +0,0 @@ -package gregtech.api.interfaces; - -public interface ICondition { - public boolean isTrue(O aObject); - - // Utility Classes for adding relations between Conditions. - - public static class Not implements ICondition { - private final ICondition mCondition; - - public Not(ICondition aCondition) { - mCondition = aCondition; - } - - @Override - public boolean isTrue(O aObject) { - return !mCondition.isTrue(aObject); - } - } - - public static class Or implements ICondition { - private final ICondition[] mConditions; - - public Or(ICondition... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition tCondition : mConditions) if (tCondition.isTrue(aObject)) return true; - return false; - } - } - - public static class Nor implements ICondition { - private final ICondition[] mConditions; - - public Nor(ICondition... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition tCondition : mConditions) if (tCondition.isTrue(aObject)) return false; - return true; - } - } - - public static class And implements ICondition { - private final ICondition[] mConditions; - - public And(ICondition... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition tCondition : mConditions) if (!tCondition.isTrue(aObject)) return false; - return true; - } - } - - public static class Nand implements ICondition { - private final ICondition[] mConditions; - - public Nand(ICondition... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition tCondition : mConditions) if (!tCondition.isTrue(aObject)) return true; - return false; - } - } - - public static class Xor implements ICondition { - private final ICondition mCondition1, mCondition2; - - public Xor(ICondition aCondition1, ICondition aCondition2) { - mCondition1 = aCondition1; - mCondition2 = aCondition2; - } - - @Override - public boolean isTrue(O aObject) { - return mCondition1.isTrue(aObject) != mCondition2.isTrue(aObject); - } - } - - public static class Equal implements ICondition { - private final ICondition mCondition1, mCondition2; - - public Equal(ICondition aCondition1, ICondition aCondition2) { - mCondition1 = aCondition1; - mCondition2 = aCondition2; - } - - @Override - public boolean isTrue(O aObject) { - return mCondition1.isTrue(aObject) == mCondition2.isTrue(aObject); - } - } -} \ No newline at end of file -- cgit