You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
746 B
25 lines
746 B
from common.game.billiards.colorBall import ColorBall
|
|
from common.game.billiards.redBall import RedBall
|
|
from common.game.billiards.cueBall import CueBall
|
|
|
|
|
|
class GameData(object):
|
|
def __init__(self):
|
|
self.left_score = 0
|
|
self.right_score = 0
|
|
self.balls: list[ColorBall | RedBall | CueBall] = []
|
|
self.last_balls: list[ColorBall | RedBall | CueBall] = []
|
|
self.goal_balls: list[int] = []
|
|
self.last_goal_balls: list[int] = []
|
|
self.collide_log: list[int] = []
|
|
pass
|
|
|
|
def collide_ball(self, ball):
|
|
self.collide_log.append(ball)
|
|
|
|
def is_stable(self) -> bool:
|
|
for _ in self.balls:
|
|
if not _.is_stable():
|
|
return False
|
|
return True
|