class Ball(object): """ :type _number: int :type _position: Vector2D :type _renderer: BallRenderer """ RADIUS = 11.25 _number = None _position = None _renderer = None def __init__(self, number, position): self._number = number self._position = position self._renderer = BallRenderer(number, position, Ball.RADIUS) @property def number(self): return self._number @property def position(self): return self._position @position.setter def position(self, new): self._position = new self._renderer.position = new def __repr__(self): return "Ball({}, {})".format(self.number, self.position) def delete(self): self._renderer.delete()
def __init__(self, number, position): self._number = number self._position = position self._renderer = BallRenderer(number, position, Ball.RADIUS)