Implement Template System for ground objects

- Factored out the current generators to use a better approach with Templates build from the dcs mission editor.
- This information is extended with a template-mapping in a json file which allows to logically group together multiple dcs groups and even statics to one template
- The combination of mapping and miz will be serialized to a template.json which is only used for loading.
- Factions now load templates during initialization and hold all the templates they can really use. This is based around the faction file.
- Implemented a template randomizer which allows to add some randomization to templates
- Each Template Group can have 1 randomizer which randomizes unit_type and size based on the mapping definition. Larger groups need to be devided in more fine detailed groups as we can now handle them better due to the change from dcs group types to our own classes.
- Rewritten the ArmorGroup, Naval and EWR template handling

Rework GroundObjectBuyMenu to support templates
This commit is contained in:
RndName
2022-01-19 13:06:19 +01:00
parent d154069877
commit 5febcdd4e4
11 changed files with 1884 additions and 591 deletions

View File

@@ -158,7 +158,7 @@ class ProcurementAi:
worst_balanced: Optional[GroundUnitClass] = None
worst_fulfillment = math.inf
for unit_class in GroundUnitClass:
if not self.faction.has_access_to_unittype(unit_class):
if not self.faction.has_access_to_unit_class(unit_class):
continue
current_ratio = self.cost_ratio_of_ground_unit(cp, unit_class)