config: Generalize sector build materials storage

Sectors require lcms and hcms to build.  The build materials are
exposed as sect-chr columns lcms, hcms (struct dchrstr members d_lcms,
d_hcms).  They are per point per point of efficiency.  In contrast,
unit build materials are defined for 100%.

We want to define build materials for 100% now, for flexibility and
consistency, and we want to optionally support more build materials in
the future.  Replace d_lcms and d_hcms by array member d_mat[], and
replace selectors lcms and hcms by selectors l_build and h_build.

This is an xdump compatibility break.  To provide the customary grace
period, we'd have to make selectors lcms and hcms virtual instead,
with value l_build / 100 and h_build / 100 rounded up, and deprecate
them.  Deities would have to avoid l_build and h_build values that
aren't multiples of 100 for this to work fully.  But we're not
bothering with maintaining xdump compatibility in this release.

Provide selectors for all other item types, to help clients prepare
for future additional materials.  Use CA_DUMP_ONLY to keep them out of
configuration tables until they actually work.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-05 20:08:30 +02:00
parent 826fcf009b
commit bb9619c053
6 changed files with 93 additions and 101 deletions

View file

@ -112,9 +112,9 @@ struct dchrstr {
float d_ostr; /* offensive strength */
float d_dstr; /* defensive strength */
int d_value; /* resale ("collect") value */
short d_mat[I_MAX+1]; /* materials to build 100% */
/* only I_LCM and I_HCM non-zero */
int d_cost; /* cost to build 100% */
int d_lcms; /* lcm's needed per point of eff */
int d_hcms; /* hcm's needed per point of eff */
int d_maint; /* maintenance cost per ETU */
int d_maxpop; /* maximum population */
int d_flags; /* capability flags */