Skip to content

Commit

Permalink
Add Missing OperationMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Dueris committed May 26, 2024
1 parent 91b76e4 commit b5522d3
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions origins/src/main/java/me/dueris/genesismc/util/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,10 @@ private static <T extends Number> Map<String, BinaryOperator<T>> createOperation
BinaryOperator<T> multiplication,
BinaryOperator<T> division,
BinaryOperator<T> multiplyBase,
BinaryOperator<T> multiplyTotal) {
BinaryOperator<T> multiplyTotal,
BinaryOperator<T> multiplyTotalAddictive,
BinaryOperator<T> minBase,
BinaryOperator<T> maxBase) {

Map<String, BinaryOperator<T>> operationMap = new HashMap<>();
operationMap.put("addition", addition);
Expand All @@ -548,6 +551,12 @@ private static <T extends Number> Map<String, BinaryOperator<T>> createOperation
operationMap.put("multiply_base_additive", multiplyBase);
operationMap.put("multiply_base_multiplicative", multiplyTotal);
operationMap.put("add_base_late", addition);
operationMap.put("multiply_total_additive", multiplyTotalAddictive);
operationMap.put("multiply_total_multiplicative", multiplyTotal);
operationMap.put("min_base", minBase);
operationMap.put("max_base", maxBase);
operationMap.put("min_total", minBase);
operationMap.put("max_total", maxBase);

return operationMap;
}
Expand All @@ -559,7 +568,10 @@ public static Map<String, BinaryOperator<Double>> getOperationMappingsDouble() {
(a, b) -> a * b,
(a, b) -> a / b,
(a, b) -> a + (a * b),
(a, b) -> a * (1 + b)
(a, b) -> a * (1 + b),
(a, b) -> a * (a * b),
(a, b) -> (a > b) ? a : b,
(a, b) -> (a < b) ? a : b
);
}

Expand All @@ -570,7 +582,10 @@ public static Map<String, BinaryOperator<Integer>> getOperationMappingsInteger()
(a, b) -> a * b,
(a, b) -> a / b,
(a, b) -> a + (a * b),
(a, b) -> a * (1 + b)
(a, b) -> a * (1 + b),
(a, b) -> a * (a * b),
(a, b) -> (a > b) ? a : b,
(a, b) -> (a < b) ? a : b
);
}

Expand All @@ -581,7 +596,10 @@ public static Map<String, BinaryOperator<Float>> getOperationMappingsFloat() {
(a, b) -> a * b,
(a, b) -> a / b,
(a, b) -> a + (a * b),
(a, b) -> a * (1 + b)
(a, b) -> a * (1 + b),
(a, b) -> a * (a * b),
(a, b) -> (a > b) ? a : b,
(a, b) -> (a < b) ? a : b
);
}

Expand Down

0 comments on commit b5522d3

Please sign in to comment.