just some refactor, a line is misplaced
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user