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