diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-18 23:04:39 -0400 |
commit | 85c804fa112fd1f19c91e45d150a787cfbf0f7a8 (patch) | |
tree | cb302d8e0f46e06be0b1d391317578b165aec245 /main/java/gregtech/api/interfaces/ICondition.java | |
parent | ce25063b910bb3bdd2b0c234b185fc4077caebdb (diff) | |
download | GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.gz GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.tar.bz2 GT5-Unofficial-85c804fa112fd1f19c91e45d150a787cfbf0f7a8.zip |
Move source directory
Diffstat (limited to 'main/java/gregtech/api/interfaces/ICondition.java')
-rw-r--r-- | main/java/gregtech/api/interfaces/ICondition.java | 104 |
1 files changed, 0 insertions, 104 deletions
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<O> { - public boolean isTrue(O aObject); - - // Utility Classes for adding relations between Conditions. - - public static class Not<O> implements ICondition<O> { - private final ICondition<O> mCondition; - - public Not(ICondition<O> aCondition) { - mCondition = aCondition; - } - - @Override - public boolean isTrue(O aObject) { - return !mCondition.isTrue(aObject); - } - } - - public static class Or<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public Or(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (tCondition.isTrue(aObject)) return true; - return false; - } - } - - public static class Nor<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public Nor(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (tCondition.isTrue(aObject)) return false; - return true; - } - } - - public static class And<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public And(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (!tCondition.isTrue(aObject)) return false; - return true; - } - } - - public static class Nand<O> implements ICondition<O> { - private final ICondition<O>[] mConditions; - - public Nand(ICondition<O>... aConditions) { - mConditions = aConditions; - } - - @Override - public boolean isTrue(O aObject) { - for (ICondition<O> tCondition : mConditions) if (!tCondition.isTrue(aObject)) return true; - return false; - } - } - - public static class Xor<O> implements ICondition<O> { - private final ICondition<O> mCondition1, mCondition2; - - public Xor(ICondition<O> aCondition1, ICondition<O> aCondition2) { - mCondition1 = aCondition1; - mCondition2 = aCondition2; - } - - @Override - public boolean isTrue(O aObject) { - return mCondition1.isTrue(aObject) != mCondition2.isTrue(aObject); - } - } - - public static class Equal<O> implements ICondition<O> { - private final ICondition<O> mCondition1, mCondition2; - - public Equal(ICondition<O> aCondition1, ICondition<O> aCondition2) { - mCondition1 = aCondition1; - mCondition2 = aCondition2; - } - - @Override - public boolean isTrue(O aObject) { - return mCondition1.isTrue(aObject) == mCondition2.isTrue(aObject); - } - } -}
\ No newline at end of file |