def played_oppo(self, line): try: return (2, self.log.get_entity(state('played_oppo'), 'name', line)) except SearchError: pass else: return None
def game_beginning(self): self._refresh() games = self.log.search(0, state('game_begin')) if games != []: return games[-1][1] else: return -1
def next_turn(self, line): try: self.log.get_entity(state('turn'), '', line) return True except SearchError: pass else: return False