-
Notifications
You must be signed in to change notification settings - Fork 8
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
draft for factory production #144
base: master
Are you sure you want to change the base?
Conversation
void FactoryProducer::produce( | ||
const fixed_point_t input_modifier, const fixed_point_t throughput_modifier, const fixed_point_t output_modifier | ||
) { | ||
std::map<PopType const* const, fixed_point_t> employees_per_job {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be cached as a private field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this definitely should be cached, we'll also need it for tooltips
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think tooltips should be calculated on demand. It saves a memory and ensures the tooltips are up to date.
@@ -37,3 +44,64 @@ fixed_point_t FactoryProducer::get_average_profitability_last_seven_days() const | |||
|
|||
return sum / (1 + profit_history_current); | |||
} | |||
|
|||
void FactoryProducer::produce( | |||
const fixed_point_t input_modifier, const fixed_point_t throughput_modifier, const fixed_point_t output_modifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine the country calls some method on each state, which calls this method for each factory.
The country & state create the modifier values here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work with the equations, nice to see that we already have all these components available.
void FactoryProducer::produce( | ||
const fixed_point_t input_modifier, const fixed_point_t throughput_modifier, const fixed_point_t output_modifier | ||
) { | ||
std::map<PopType const* const, fixed_point_t> employees_per_job {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this definitely should be cached, we'll also need it for tooltips
f275652
to
57b7a64
Compare
b004547
to
1c0505e
Compare
First pass at pops (test pops and density mapmode)
TODO: