コード例 #1
0
ファイル: command.py プロジェクト: andrewswan/lwotai
 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): "
コード例 #2
0
 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)
コード例 #3
0
ファイル: types.py プロジェクト: andrewswan/lwotai
 def __init__(self, name):
     self.__name = Utils.require_type(name, str)