mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Issue 3204 (#3458)
This issue addresses Issue #3204 by allowing factions to set a different weapon introduction date.
This commit is contained in:
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
import itertools
|
||||
import logging
|
||||
from dataclasses import dataclass, field
|
||||
import datetime
|
||||
from functools import cached_property
|
||||
from typing import Any, Dict, Iterator, List, Optional, TYPE_CHECKING, Type
|
||||
|
||||
@@ -118,6 +119,10 @@ class Faction:
|
||||
#: both will use it.
|
||||
unrestricted_satnav: bool = False
|
||||
|
||||
#: Overrides default weapons introduction years for faction. Maps names of
|
||||
#: weapons groups to their introduction years.
|
||||
weapons_introduction_year_overrides: Dict[str, int] = field(default_factory=dict)
|
||||
|
||||
def has_access_to_dcs_type(self, unit_type: Type[DcsUnitType]) -> bool:
|
||||
# Vehicle and Ship Units
|
||||
if any(unit_type == u.dcs_unit_type for u in self.accessible_units):
|
||||
@@ -262,6 +267,10 @@ class Faction:
|
||||
|
||||
faction.unrestricted_satnav = json.get("unrestricted_satnav", False)
|
||||
|
||||
faction.weapons_introduction_year_overrides = json.get(
|
||||
"weapons_introduction_year_overrides", {}
|
||||
)
|
||||
|
||||
return faction
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user