mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
carrier ops; persistency; ui improvements; refactoring
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
import typing
|
||||
import math
|
||||
import random
|
||||
import itertools
|
||||
|
||||
import dcs
|
||||
|
||||
from shop import db
|
||||
from game import db
|
||||
from theater.controlpoint import ControlPoint
|
||||
|
||||
from dcs.planes import *
|
||||
@@ -105,6 +102,10 @@ class Base:
|
||||
|
||||
return 0
|
||||
|
||||
def filter_units(self, applicable_units: typing.Collection):
|
||||
self.aircraft = {k: v for k, v in self.aircraft.items() if k in applicable_units}
|
||||
self.armor = {k: v for k, v in self.aircraft.items() if k in applicable_units}
|
||||
|
||||
def commision_units(self, units: typing.Dict[typing.Any, int]):
|
||||
for value in units.values():
|
||||
assert value > 0
|
||||
|
||||
@@ -40,5 +40,5 @@ class ConflictTheater:
|
||||
for connected_point in [x for x in cp.connected_points if x.captured != from_player]:
|
||||
yield (cp, connected_point)
|
||||
|
||||
def enemy_bases(self) -> typing.Collection[ControlPoint]:
|
||||
def enemy_points(self) -> typing.Collection[ControlPoint]:
|
||||
return [point for point in self.controlpoints if not point.captured]
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
import typing
|
||||
import random
|
||||
|
||||
import dcs
|
||||
|
||||
from shop import db
|
||||
from theater.controlpoint import *
|
||||
from theater.base import *
|
||||
from theater.conflicttheater import *
|
||||
|
||||
@@ -13,7 +6,7 @@ UNIT_AMOUNT_FACTOR = 1
|
||||
|
||||
|
||||
def generate_initial(theater: ConflictTheater, enemy: str):
|
||||
for cp in theater.enemy_bases():
|
||||
for cp in theater.enemy_points():
|
||||
if cp.captured:
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user