Fix some typing in preparation for pydcs types.

Not complete, but progress.
This commit is contained in:
Dan Albert
2021-07-08 22:50:55 -07:00
parent fb9a0fe833
commit 53f6a0b32b
30 changed files with 208 additions and 193 deletions

View File

@@ -30,16 +30,16 @@ class PendingUnitDeliveries:
self.destination = destination
# Maps unit type to order quantity.
self.units: dict[UnitType[DcsUnitType], int] = defaultdict(int)
self.units: dict[UnitType[Any], int] = defaultdict(int)
def __str__(self) -> str:
return f"Pending delivery to {self.destination}"
def order(self, units: dict[UnitType[DcsUnitType], int]) -> None:
def order(self, units: dict[UnitType[Any], int]) -> None:
for k, v in units.items():
self.units[k] += v
def sell(self, units: dict[UnitType[DcsUnitType], int]) -> None:
def sell(self, units: dict[UnitType[Any], int]) -> None:
for k, v in units.items():
self.units[k] -= v