Merge forcegroups with the same task

This commit is contained in:
RndName
2022-03-22 15:19:36 +01:00
parent 9a2fa50b0f
commit f0a3fd1e3a
3 changed files with 9 additions and 10 deletions

View File

@@ -160,8 +160,9 @@ class ForceGroup:
return random.choice(self.dcs_unit_types_for_group(group))
def update_group(self, new_group: ForceGroup) -> None:
"""Update the group from another group. This will merge statics and layouts."""
# Merge layouts and statics
"""Update the group from another group.
This will merge units, statics and layouts."""
self.units = list(set(self.units + new_group.units))
self.statics = list(set(self.statics + new_group.statics))
self.layouts = list(set(self.layouts + new_group.layouts))