Пример #1
0
 def reset_game(self):
     """ Resets the game to initial state.
     """
     self.game = Game(self.game_name,
                      observed=True,
                      num_players=self.num_players,
                      num_turns=self.num_turns,
                      map_name=self.map_name)
     self.players = {}
     self.current_turn = 0
     self.current_action = 0
Пример #2
0
 def reset_game(self):
     """ Resets the game to initial state.
     """
     self._game = Game(self._game_name,
                       self._map_name,
                       num_players=self.num_players,
                       observed=True)
     for action in self._actions:
         if action['code'] == Action.LOGIN:
             data = json.loads(action['message'])
             self._game.add_player(Player.create(data['name']))
     self._current_turn = 0
     self._current_action = 0
Пример #3
0
 def __init__(self, argv):
     self.db = None
     self.game = Game(argv[1])