Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of recalculateOutputPrices() function #51

Closed
aritchie05 opened this issue Jun 15, 2022 · 0 comments
Closed

Improve performance of recalculateOutputPrices() function #51

aritchie05 opened this issue Jun 15, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@aritchie05
Copy link
Owner

Right now this method just recalculates all output prices 10 times in a row (horribly inefficient). This is done to ensure dependent prices are guaranteed to be correct for other output recipes.

For example, if the output list has Iron Bar and Iron Pickaxe, we need to make sure the output price of Iron Bar is correct before using that price for the Iron Bar ingredient in the Iron Pickaxe recipe. Right now it is just brute forced. The goal should be an "OutputPriceCorrect" flag on each output recipe that is set to false when we need to recalculate prices, and is set to true if the price is calculated with only ingredients that are in the Inputs section, OR with ingredients in the Outputs section that have their OutputPriceCorrect flag already true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant