Made calculateMaxAffordable, calculateCost, and cost requirements interface a bit cleaner #17

Merged
thepaperpilot merged 6 commits from feature/requirements-refactor into main 2023-05-17 23:52:28 +00:00
Showing only changes of commit 4e9fb1bc9b - Show all commits

View file

@ -187,19 +187,9 @@ describe("Creating cost requirement", () => {
unref(
createCostRequirement(() => ({
resource,
cost: Formula.variable(resource).times(0),
maxBulkAmount: 10
})).requirementMet
)
).compare_tolerance(10));
test("Direct sum respected", () =>
expect(
unref(
createCostRequirement(() => ({
resource,
cost: Formula.variable(resource).times(0),
maxBulkAmount: 10
cost: Formula.variable(resource).times(0.0001),
maxBulkAmount: 10,
cumulativeCost: false
})).requirementMet
)
).compare_tolerance(10));