'''A world for testing the network''' class LocalWorld(): def __init__ (self, x=10, y=10, startSpecies = None): """Fills an x by y board with the default species (most often will be the dead species)""" self.width = x self.height = y self.listeners = [] def __str__(self): """Returns a string of human readable attributes of localworld.""" printer = "" for i in range(self.height): printer += "\n" for j in range(self.width): printer += self.__board[j][i].__str__() + " " return ("Width: " + str(self.width) + " Height: " + str(self.height) + " " + printer + "\n") def addListener(self, listener): self.listeners.append(listener) def update(self, changes): for x in self.listeners: x.update(changes) def main(): pass