mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
RoundRobinize random livery selection from livery_set
This commit is contained in:
@@ -92,6 +92,9 @@ class Squadron:
|
||||
return False
|
||||
return self.id == other.id
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
self._livery_pool: list[str] = []
|
||||
|
||||
@property
|
||||
def player(self) -> bool:
|
||||
return self.coalition.player
|
||||
@@ -104,6 +107,15 @@ class Squadron:
|
||||
def pilot_limits_enabled(self) -> bool:
|
||||
return self.settings.enable_squadron_pilot_limits
|
||||
|
||||
def random_round_robin_livery_from_set(self) -> str:
|
||||
livery = random.choice(self.livery_set)
|
||||
self._livery_pool.append(livery)
|
||||
self.livery_set.remove(livery)
|
||||
if not self.livery_set:
|
||||
self.livery_set = self._livery_pool
|
||||
self._livery_pool = []
|
||||
return livery
|
||||
|
||||
def set_auto_assignable_mission_types(
|
||||
self, mission_types: Iterable[FlightType]
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user