mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Use the actual Country type instead of the name.
We want other pieces of country information (in particular the short names). This cleans up a lot of code anyway. As an added bonus, this now catches squadrons that used invalid names which would previously be passed through to pydcs and... then I don't know what would happen.
This commit is contained in:
@@ -7,6 +7,7 @@ from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from typing import Optional, Sequence, TYPE_CHECKING
|
||||
|
||||
from dcs.country import Country
|
||||
from faker import Faker
|
||||
|
||||
from game.ato import Flight, FlightType, Package
|
||||
@@ -28,7 +29,7 @@ if TYPE_CHECKING:
|
||||
class Squadron:
|
||||
name: str
|
||||
nickname: Optional[str]
|
||||
country: str
|
||||
country: Country
|
||||
role: str
|
||||
aircraft: AircraftType
|
||||
max_size: int
|
||||
@@ -71,7 +72,7 @@ class Squadron:
|
||||
(
|
||||
self.name,
|
||||
self.nickname,
|
||||
self.country,
|
||||
self.country.id,
|
||||
self.role,
|
||||
self.aircraft,
|
||||
)
|
||||
@@ -418,7 +419,6 @@ class Squadron:
|
||||
|
||||
flight = Flight(
|
||||
package,
|
||||
self.coalition.country_name,
|
||||
self,
|
||||
size,
|
||||
FlightType.FERRY,
|
||||
|
||||
Reference in New Issue
Block a user