just some refactor, a line is misplaced
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import math
|
||||
import random
|
||||
|
||||
from typing import List, Tuple
|
||||
|
||||
@@ -14,12 +13,10 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from grid.ui.items import (
|
||||
AgilitySphereGraphicsItem,
|
||||
HPSphereGraphicsItem,
|
||||
SphereGraphicsItem,
|
||||
ArcGraphicsItem,
|
||||
LineGraphicsItem,
|
||||
StrenghSphereGraphicsItem,
|
||||
random_sphere_factory,
|
||||
)
|
||||
|
||||
|
||||
@@ -47,10 +44,10 @@ class Pattern(QGraphicsItemGroup):
|
||||
LineGraphicsItem(line_start_x, line_start_y, line_end_x, line_end_y, self)
|
||||
)
|
||||
|
||||
line_start_x = top_left_corner_x + center_x
|
||||
line_start_x = center_x
|
||||
line_start_y = top_left_corner_y + self.SPACE_BETWEEN_SPHERE * 1.5
|
||||
line_end_x = top_left_corner_x + center_x
|
||||
line_end_y = top_left_corner_y + self.SPACE_BETWEEN_SPHERE * 2.5
|
||||
line_end_x = center_x
|
||||
line_end_y = top_left_corner_y + self.SPACE_BETWEEN_SPHERE # * 2.5
|
||||
self.addToGroup(
|
||||
LineGraphicsItem(line_start_x, line_start_y, line_end_x, line_end_y, self)
|
||||
)
|
||||
@@ -74,13 +71,7 @@ class Pattern(QGraphicsItemGroup):
|
||||
center_x, center_y, self.SPACE_BETWEEN_SPHERE, sphere_on_circle
|
||||
)
|
||||
for x, y in points:
|
||||
rand = random.random()
|
||||
if rand > 2 / 3:
|
||||
self.addToGroup(SphereGraphicsItem(x, y))
|
||||
elif rand > 1 / 3:
|
||||
self.addToGroup(AgilitySphereGraphicsItem(x, y))
|
||||
else:
|
||||
self.addToGroup(StrenghSphereGraphicsItem(x, y))
|
||||
self.addToGroup(random_sphere_factory(x, y))
|
||||
|
||||
# second cercle
|
||||
sphere_on_circle = 8
|
||||
@@ -99,7 +90,7 @@ class Pattern(QGraphicsItemGroup):
|
||||
)
|
||||
)
|
||||
for x, y in points:
|
||||
self.addToGroup(SphereGraphicsItem(x, y))
|
||||
self.addToGroup(random_sphere_factory(x, y))
|
||||
# self.addToGroup(
|
||||
# ArcGraphicsItem(
|
||||
# center_x, center_y, self.SPACE_BETWEEN_SPHERE * 2, 0, 90, self
|
||||
|
||||
Reference in New Issue
Block a user