Update pydcs, adapt to new Point APIs.

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.
This commit is contained in:
Dan Albert
2022-02-21 18:14:49 -08:00
parent ff12b37431
commit 9e2e4ffa74
29 changed files with 155 additions and 186 deletions

View File

@@ -4,9 +4,9 @@ from typing import TYPE_CHECKING
import shapely.ops
from dcs import Point
from shapely.geometry import Point as ShapelyPoint, MultiPolygon
from shapely.geometry import MultiPolygon, Point as ShapelyPoint
from game.utils import nautical_miles, meters
from game.utils import meters, nautical_miles
if TYPE_CHECKING:
from game.coalition import Coalition
@@ -25,6 +25,7 @@ class IpZoneGeometry:
home: Point,
coalition: Coalition,
) -> None:
self._target = target
self.threat_zone = coalition.opponent.threat_zone.all
self.home = ShapelyPoint(home.x, home.y)
@@ -115,4 +116,4 @@ class IpZoneGeometry:
ip = self._unsafe_ip()
else:
ip = self._safe_ip()
return Point(ip.x, ip.y)
return self._target.new_in_same_map(ip.x, ip.y)