Moved some methods from QuestData to helper classes, the whole class rearranged

Moved shop-related things to QuestUtilCards.java (eg. number of shop boosters calculation)
CardShop now shows how many decks use the given card
Quest deck editor: press space to add card to your deck - that simple
CardPool no longer allows incorrect remove numbers
removed lots of senseless javadocs
This commit is contained in:
Maxmtg
2011-09-02 22:51:47 +00:00
parent 90d5514aaa
commit adb3ae979b
19 changed files with 544 additions and 989 deletions

View File

@@ -174,7 +174,11 @@ public abstract class Predicate<T> {
return new Node<T>(operand1, operator, operand2);
}
// Predefined operators: and, or
public static <T> Predicate<T> and(final Predicate<T> operand1, final Predicate<T> operand2) { return new NodeAnd<T>(operand1, operand2); }
public static <T> Predicate<T> and(final Predicate<T> operand1, final Predicate<T> operand2) {
if (operand1.is1()) { return operand2; }
if (operand2.is1()) { return operand1; }
return new NodeAnd<T>(operand1, operand2);
}
public static <T> Predicate<T> and(final Iterable<Predicate<T>> operand) { return new MultiNodeAnd<T>(operand); }
public static <T, U> Predicate<T> and(final Predicate<T> operand1, final Predicate<U> operand2, Lambda1<U, T> bridge) { return new NodeAndBridged<T, U>(operand1, operand2, bridge); }