From 33b92423d885008bc224c7f834df6f8a59dda8fa Mon Sep 17 00:00:00 2001 From: walterroach Date: Fri, 13 Nov 2020 09:03:02 -0600 Subject: [PATCH] cleanup comments remove unnecessary method call --- qt_ui/widgets/map/QLiberationMap.py | 4 ---- theater/frontline.py | 16 ++++++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/qt_ui/widgets/map/QLiberationMap.py b/qt_ui/widgets/map/QLiberationMap.py index 13538803..4d61507e 100644 --- a/qt_ui/widgets/map/QLiberationMap.py +++ b/qt_ui/widgets/map/QLiberationMap.py @@ -420,8 +420,6 @@ class QLiberationMap(QGraphicsView): if not cp.captured: scene.addLine(pos[0], pos[1], pos2[0], pos2[1], pen=pen) else: - # pass - # frontline = FrontLine(cp, connected_cp, self.game.theater.terrain) posx = frontline.position h = frontline.attack_heading pos2 = self._transform_point(posx) @@ -429,7 +427,6 @@ class QLiberationMap(QGraphicsView): seg_a = self._transform_point(segment.point_a) seg_b = self._transform_point(segment.point_b) scene.addLine(seg_a[0], seg_a[1], seg_b[0], seg_b[1], pen=pen) - # scene.addLine(pos[0], pos[1], pos2[0], pos2[1], pen=pen) p1 = point_from_heading(pos2[0], pos2[1], h+180, 25) p2 = point_from_heading(pos2[0], pos2[1], h, 25) @@ -441,7 +438,6 @@ class QLiberationMap(QGraphicsView): seg_a = self._transform_point(segment.point_a) seg_b = self._transform_point(segment.point_b) scene.addLine(seg_a[0], seg_a[1], seg_b[0], seg_b[1], pen=pen) - # scene.addLine(pos[0], pos[1], pos2[0], pos2[1], pen=pen) def wheelEvent(self, event: QWheelEvent): diff --git a/theater/frontline.py b/theater/frontline.py index 51f5c423..9cbf7608 100644 --- a/theater/frontline.py +++ b/theater/frontline.py @@ -41,7 +41,6 @@ class ComplexFrontLine: start_cp: ControlPoint points: List[Point] - # control_points: List[ControlPoint] @dataclass @@ -86,7 +85,11 @@ class FrontLine(MissionTarget): @property def position(self): - return self._calculate_position() + """ + The position where the conflict should occur + according to the current strength of each control point. + """ + return self.point_from_a(self._position_distance) @property def control_points(self) -> Tuple[ControlPoint, ControlPoint]: @@ -124,13 +127,6 @@ class FrontLine(MissionTarget): ) return self.segments[0] - def _calculate_position(self) -> Point: - """ - The position where the conflict should occur - according to the current strength of each control point. - """ - return self.point_from_a(self._position_distance) - def point_from_a(self, distance: Numeric) -> Point: """ Returns a point {distance} away from control_point_a along the frontline segments. @@ -151,7 +147,7 @@ class FrontLine(MissionTarget): @property def _position_distance(self) -> float: """ - The distance from point a where the conflict should occur + The distance from point "a" where the conflict should occur according to the current strength of each control point """ total_strength = (