From 0b1100a8b5f8ad94170d0171f9b0c2232eda5895 Mon Sep 17 00:00:00 2001 From: Timothee Groleau Date: Thu, 30 Jul 2020 13:52:30 +0800 Subject: [PATCH] Update state without checking values --- nestris_ocr/scan_strat/base_strategy.py | 2 +- nestris_ocr/scan_strat/naive_strategy.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nestris_ocr/scan_strat/base_strategy.py b/nestris_ocr/scan_strat/base_strategy.py index 5734a8c..5d90a61 100644 --- a/nestris_ocr/scan_strat/base_strategy.py +++ b/nestris_ocr/scan_strat/base_strategy.py @@ -30,7 +30,7 @@ def __init__(self): self.start_level = None self.field = None self.preview = None - self.gameid = 0 + self.gameid = 1 self.piece_stats = PieceStatAccumulator() self.gamestate = GameState.MENU self.cur_piece = None diff --git a/nestris_ocr/scan_strat/naive_strategy.py b/nestris_ocr/scan_strat/naive_strategy.py index ebe4c0a..e54928e 100644 --- a/nestris_ocr/scan_strat/naive_strategy.py +++ b/nestris_ocr/scan_strat/naive_strategy.py @@ -25,6 +25,7 @@ class NaiveStrategy(BaseStrategy): def __init__(self, *args): super(NaiveStrategy, self).__init__(*args) + self.gamestate = GameState.IN_GAME # allows starting OCR mid-game self.tasks = self.setup_tasks() self.interpolate = config["calibration.color_interpolation"] @@ -81,7 +82,7 @@ def update_menu(self): if self.lines and self.score and self.level: self.gamestate = GameState.IN_GAME - if self.lines == "000" and self.score == "000000": + if (self.lines == "000" or self.lines == "025") and self.score == "000000": return True return False