Decouple unit deliveries and conflict events.

Fixes https://github.com/Khopa/dcs_liberation/issues/692 and lets us
clean up the interface quite a bit.
This commit is contained in:
Dan Albert
2021-01-01 13:48:23 -08:00
parent de325c1208
commit 9671542bdf
5 changed files with 28 additions and 63 deletions

View File

@@ -36,7 +36,6 @@ class QRecruitBehaviour:
@property
def pending_deliveries(self) -> UnitsDeliveryEvent:
assert self.cp.pending_unit_deliveries
return self.cp.pending_unit_deliveries
@property
@@ -128,7 +127,7 @@ class QRecruitBehaviour:
def buy(self, unit_type: Type[UnitType]):
price = db.PRICES[unit_type]
if self.budget >= price:
self.pending_deliveries.deliver({unit_type: 1})
self.pending_deliveries.order({unit_type: 1})
self.budget -= price
else:
# TODO : display modal warning