- def __init__(self):
- # This is a very simple deck to allow testing more drawing logic
- # on tiles. These will need to be replaced with better stuff.
- self.gameboard = GameBoard.new_game(
- locations_definition=[
- {'actions': []},
- {'actions': [{'required_bits': [BITS['CYAN']],
- 'action_class': 'DoNothing'}]},
- {'actions': [{'required_bits': [BITS['YELLOW']],
- 'action_class': 'DoNothing'}]},
- {'actions': [{'required_bits': [BITS['YELLOW'], BITS['MAGENTA']],
- 'action_class': 'DoNothing'}]},
- ])
+ def __init__(self, gameboard):
+ self.gameboard = gameboard
+
+ @classmethod
+ def new(cls, deck='standard', **kw):
+ deck = load_location_deck(deck)
+ return cls(GameBoard.new_game(deck, **kw))
+
+ @classmethod
+ def load(cls, data):
+ return cls(GameBoard.import_game(data))