self._base_surf = surf
self._orig_surf = self._surf = rotate(surf, self._angle)
self._update_pos()
+
+
+class SelectableSurfActor(OrientatedSurfActor):
+ def __init__(self, seat, selected_seat):
+ self._selected = False
+ self._seat = seat
+ self._selected_seat = selected_seat
+ super().__init__(surf=self._seat, angle=0)
+
+ @property
+ def selected(self):
+ return self._selected
+
+ @selected.setter
+ def selected(self, value):
+ self._selected = value
+ self.surf = self._selected_seat if value else self._seat
from itertools import chain, islice, repeat
from pygame.constants import BLEND_RGBA_MULT
from pgzero.loaders import images
-from ..actors.orientatedsurf import OrientatedSurfActor
+from ..actors.orientatedsurf import SelectableSurfActor
from ..actors.animsurf import AnimatedSurfActor
from ..weapons import default_weapons
selected_seat = seat.copy()
selected_seat.fill(
self.vehicle.selected_seat_overlay_color, None, BLEND_RGBA_MULT)
- return SeatActor(seat, selected_seat)
-
-
-class SeatActor(OrientatedSurfActor):
- def __init__(self, seat, selected_seat):
- self._selected = False
- self._seat = seat
- self._selected_seat = selected_seat
- super().__init__(surf=self._seat, angle=0)
-
- @property
- def selected(self):
- return self._selected
-
- @selected.setter
- def selected(self, value):
- self._selected = value
- self.surf = self._selected_seat if value else self._seat
+ return SelectableSurfActor(seat, selected_seat)
def circle_of_seats(n_seats, **kw):