production: Use update code instead of duplicating it
prod() duplicates the update's sector production code, except it computes both output with present materials ("make" output) and output not limited by lack of materials or production backlog ("max" output). It also rounds materials consumed up instead of randomly. Factor prod_output() out of produce() for reuse by prod(). prod() runs it twice: once for "make" output and once for "max" output. Test output changes are due to random rounding. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
6013758272
commit
4a714a37da
6 changed files with 215 additions and 229 deletions
|
@ -133,6 +133,7 @@ extern void bank_income(struct sctstr *, int);
|
|||
extern void pay_reserve(struct natstr *, int);
|
||||
/* produce.c */
|
||||
extern void produce(struct natstr *, struct sctstr *);
|
||||
extern double prod_output(struct sctstr *, double);
|
||||
extern double prod_materials_cost(struct pchrstr *, short[], int *);
|
||||
extern double prod_resource_limit(struct pchrstr *, unsigned char *);
|
||||
extern double prod_eff(int, float);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue