Skip to content

Commit

Permalink
Fixed parameter order in Predicates.
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikmaeckel committed Feb 29, 2024
1 parent a95366b commit 199a88c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import tools.aqua.stars.core.types.*
* @param S [SegmentType].
* @param U [TickUnit].
* @param D [TickDifference].
* @property eval The evaluation function on the [PredicateContext].
* @property kClasses The actors.
* @property eval The evaluation function on the [PredicateContext].
*/
class BinaryPredicate<
E1 : E,
Expand All @@ -41,8 +41,8 @@ class BinaryPredicate<
S : SegmentType<E, T, S, U, D>,
U : TickUnit<U, D>,
D : TickDifference<D>>(
val kClasses: Pair<KClass<E1>, KClass<E2>>,
val eval: (PredicateContext<E, T, S, U, D>, E1, E2) -> Boolean,
val kClasses: Pair<KClass<E1>, KClass<E2>>
) {

/**
Expand Down Expand Up @@ -99,8 +99,8 @@ class BinaryPredicate<
S : SegmentType<E, T, S, U, D>,
U : TickUnit<U, D>,
D : TickDifference<D>> predicate(
kClasses: Pair<KClass<E1>, KClass<E2>>,
eval: (PredicateContext<E, T, S, U, D>, E1, E2) -> Boolean,
kClasses: Pair<KClass<E1>, KClass<E2>>
): BinaryPredicate<E1, E2, E, T, S, U, D> = BinaryPredicate(eval, kClasses)
): BinaryPredicate<E1, E2, E, T, S, U, D> = BinaryPredicate(kClasses,eval)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import tools.aqua.stars.core.types.*
* @param S [SegmentType].
* @param U [TickUnit].
* @param D [TickDifference].
* @property eval The evaluation function on the [PredicateContext].
* @property kClass The actor.
* @property eval The evaluation function on the [PredicateContext].
*/
class UnaryPredicate<
E1 : E,
Expand All @@ -39,8 +39,8 @@ class UnaryPredicate<
S : SegmentType<E, T, S, U, D>,
U : TickUnit<U, D>,
D : TickDifference<D>>(
val kClass: KClass<E1>,
val eval: (PredicateContext<E, T, S, U, D>, E1) -> Boolean,
val kClass: KClass<E1>
) {
/**
* Check if this predicate holds (i.e. is true) in the given context.
Expand Down Expand Up @@ -91,8 +91,8 @@ class UnaryPredicate<
S : SegmentType<E, T, S, U, D>,
U : TickUnit<U, D>,
D : TickDifference<D>> predicate(
kClass: KClass<E1>,
eval: (PredicateContext<E, T, S, U, D>, E1) -> Boolean,
kClass: KClass<E1>
): UnaryPredicate<E1, E, T, S, U, D> = UnaryPredicate(eval, kClass)
): UnaryPredicate<E1, E, T, S, U, D> = UnaryPredicate(kClass, eval)
}
}

0 comments on commit 199a88c

Please sign in to comment.