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

@ -64,7 +64,7 @@
# econfig key custom_tables.
config sect-chr
uid mnem prd peff val lcm hcm cost maint name ...
uid mnem prd peff val l_b h_b cost maint name ...
0 "." -1 0 0 0 0 0 0 "sea"
1 "^" dust 75 5 0 0 100 0 "mountain"
2 "s" -1 0 127 0 0 0 0 "sanctuary"
@ -72,7 +72,7 @@ uid mnem prd peff val lcm hcm cost maint name ...
4 "-" -1 0 1 0 0 0 0 "wilderness"
# Uncomment one of the following two. The second one is for big cities.
5 "c" -1 0 30 0 0 100 1 "capital"
# 5 "c" -1 0 30 1 2 1000 1 "city"
# 5 "c" -1 0 30 100 200 1000 1 "city"
6 "u" rad 100 15 0 0 100 0 "uranium mine"
7 "p" hap 100 5 0 0 100 0 "park"
8 "d" gun 100 7 0 0 100 0 "defense plant"
@ -86,7 +86,7 @@ uid mnem prd peff val lcm hcm cost maint name ...
16 "o" oil 100 5 0 0 100 0 "oil field"
17 "j" lcm 100 3 0 0 100 0 "light manufacturing"
18 "k" hcm 100 4 0 0 100 0 "heavy manufacturing"
19 "f" -1 0 10 0 1 500 0 "fortress"
19 "f" -1 0 10 0 100 500 0 "fortress"
20 "t" tech 100 10 0 0 100 0 "technical center"
21 "r" med 100 9 0 0 100 0 "research lab"
22 "n" -1 0 10 0 0 100 0 "nuclear plant"