"""Provides a World class to allow a Ball to query the dimensions of the world.""" class World: def __init__(self, w, h): self._w = w self._h = h self._balls = set() def getWidth(self): return self._w def getHeight(self): return self._h def getBalls(self): return list(self._balls) def addBall(self, b): return self._balls.add(b) def removeBall(self, b): return self._balls.discard(b)