+def load_game(parser, slot_num):
+ '''
+ Load a save game and store it in parser.values.game_state.
+ '''
+ from naja.scenes.load_save import SaveGameSlot
+ if not (0 <= slot_num <= 7):
+ parser.error("--load accepts a slot number from 0 to 7.")
+ state = SaveGameSlot(slot_num).load()
+ if state is None:
+ raise parser.error(
+ "Could not load game from slot %s" % (slot_num,))
+ options.game_state = state
+
+
+def load_deck(parser, deck):
+ '''
+ Create a new game for a specific deck and store it in
+ parser.values.game_state.
+ '''
+ from naja.gamestate import GameState
+ try:
+ state = GameState.new(deck=deck)
+ except:
+ if options.debug:
+ raise
+ parser.error("Could not load deck %r" % (deck,))
+ options.game_state = state
+
+