Remove one user of UNIT_BY_TASK.

This commit is contained in:
Dan Albert
2021-06-07 18:00:57 -07:00
parent 914691eaa7
commit ef35ad90b8
6 changed files with 19 additions and 41 deletions

View File

@@ -1331,18 +1331,6 @@ def upgrade_to_supercarrier(unit, name: str):
return unit
def unit_task(unit: UnitType) -> Optional[Task]:
for task, units in UNIT_BY_TASK.items():
if unit in units:
return task
if unit in SAM_CONVERT:
return unit_task(SAM_CONVERT[unit])
print(unit.name + " cause issue")
return None
def find_unittype(for_task: Type[MainTask], country_name: str) -> List[Type[UnitType]]:
return [x for x in UNIT_BY_TASK[for_task] if x in FACTIONS[country_name].units]