def __init__(self, app, saver=Saver(), complete_key='tab', std_in=None, std_out=None): Cmd.__init__(self, complete_key, std_in, std_out) self.__country_names = app.get_country_names() self.__game_attributes = ["cells", "funding", "ideology", "lapsing", "marker", "prestige"] self.app = Utils.require_type(app, Labyrinth) self.saver = Utils.require_type(saver, Saver) self.prompt = "Enter command (? for help, Tab to complete): "
def _save_game(app, save_file_name): """Saves the given game to the given file""" Utils.require_type(app, Labyrinth) with open(save_file_name, 'wb') as save_file: pickle.dump(app, save_file, 2)
def __init__(self, name): self.__name = Utils.require_type(name, str)