just some refactor, a line is misplaced
All checks were successful
CI/CD / wol (push) Successful in 0s
CI/CD / build (push) Successful in 9m23s

This commit is contained in:
2025-08-27 21:45:59 +02:00
parent 50b783c1df
commit 7adb7ed34a
2 changed files with 24 additions and 15 deletions

View File

@@ -1,4 +1,5 @@
import logging
import random
from PySide6.QtCore import QRectF, Qt
from PySide6.QtGui import QBrush, QPainter, QPen
@@ -59,6 +60,23 @@ class AgilitySphereGraphicsItem(SphereGraphicsItem):
def __init__(self, x_pos: int, y_pos: int) -> None:
super().__init__(x_pos, y_pos, Qt.GlobalColor.darkYellow)
class EmptySphereGraphicsItem(SphereGraphicsItem):
def __init__(self, x_pos: int, y_pos: int) -> None:
self.SPHERE_WIDTH = 20
super().__init__(x_pos, y_pos, Qt.GlobalColor.black)
@staticmethod
def random_sphere_factory(x_pos: int, y_pos: int) -> SphereGraphicsItem:
rand = random.random()
if rand > 3 / 4:
obj = SphereGraphicsItem(x_pos, y_pos)
elif rand > 2 / 4:
obj = AgilitySphereGraphicsItem(x_pos, y_pos)
elif rand > 1 / 4:
obj = StrenghSphereGraphicsItem(x_pos, y_pos)
else:
obj = EmptySphereGraphicsItem(x_pos, y_pos)
return obj
class ArcGraphicsItem(QGraphicsItem):
"""Circle arc."""