mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
This is briefly moving us over to my fork of pydcs while we wait for https://github.com/pydcs/dcs/pull/206 to be merged. The adaptation is invasive enough that I don't want it lingering for long.
23 lines
495 B
Python
23 lines
495 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Dict, TYPE_CHECKING
|
|
|
|
from dcs import Point
|
|
|
|
from .latlon import LatLon
|
|
|
|
if TYPE_CHECKING:
|
|
from .conflicttheater import ConflictTheater
|
|
|
|
|
|
@dataclass
|
|
class Bullseye:
|
|
position: Point
|
|
|
|
def to_pydcs(self) -> Dict[str, float]:
|
|
return {"x": self.position.x, "y": self.position.y}
|
|
|
|
def to_lat_lon(self, theater: ConflictTheater) -> LatLon:
|
|
return theater.point_to_ll(self.position)
|