mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
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:
@@ -3,21 +3,19 @@ from __future__ import annotations
|
||||
import math
|
||||
|
||||
from dcs import Point
|
||||
from dcs.terrain import Terrain
|
||||
|
||||
from game.utils import Heading
|
||||
|
||||
|
||||
class PointWithHeading(Point):
|
||||
def __init__(self) -> None:
|
||||
super(PointWithHeading, self).__init__(0, 0)
|
||||
self.heading: Heading = Heading.from_degrees(0)
|
||||
def __init__(self, x: float, y: float, heading: Heading, terrain: Terrain) -> None:
|
||||
super().__init__(x, y, terrain)
|
||||
self.heading: Heading = heading
|
||||
|
||||
@staticmethod
|
||||
def from_point(point: Point, heading: Heading) -> PointWithHeading:
|
||||
p = PointWithHeading()
|
||||
p.x = point.x
|
||||
p.y = point.y
|
||||
p.heading = heading
|
||||
return p
|
||||
return PointWithHeading(point.x, point.y, heading, point._terrain)
|
||||
|
||||
def rotate(self, origin: Point, heading: Heading) -> None:
|
||||
"""Rotates the Point by a given angle clockwise around the origin"""
|
||||
|
||||
Reference in New Issue
Block a user