Basic implementation of road based transfers.

This adds the models and UIs for creating ground unit transfer orders.
Most of the feature is still missing:

* The AI doesn't do them.
* Transfers can move across the whole map in one turn.
* Transfers between disconnected bases are allowed.
* Transfers are not modeled in the simulation, so they can't be
  interdicted.

https://github.com/Khopa/dcs_liberation/issues/824
This commit is contained in:
Dan Albert
2021-02-15 12:49:36 -08:00
parent b65d178cf1
commit e9ff554f39
12 changed files with 702 additions and 30 deletions

View File

@@ -34,6 +34,7 @@ from .settings import Settings
from .theater import ConflictTheater, ControlPoint, TheaterGroundObject
from game.theater.theatergroundobject import MissileSiteGroundObject
from .threatzones import ThreatZones
from .transfers import PendingTransfers
from .unitmap import UnitMap
from .weather import Conditions, TimeOfDay
@@ -121,6 +122,8 @@ class Game:
self.aircraft_inventory = GlobalAircraftInventory(self.theater.controlpoints)
self._transfers = PendingTransfers()
self.sanitize_sides()
self.on_load()
@@ -151,6 +154,14 @@ class Game:
# Regenerate any state that was not persisted.
self.on_load()
@property
def transfers(self) -> PendingTransfers:
try:
return self._transfers
except AttributeError:
self._transfers = PendingTransfers()
return self._transfers
def generate_conditions(self) -> Conditions:
return Conditions.generate(
self.theater, self.current_day, self.current_turn_time_of_day, self.settings
@@ -264,6 +275,8 @@ class Game:
for control_point in self.theater.controlpoints:
control_point.process_turn(self)
self.transfers.complete_transfers()
self.process_enemy_income()
self.process_player_income()