added color switch and reset trigger

This commit is contained in:
2022-10-14 16:50:09 +02:00
parent a77f66cb77
commit d9a304523e

View File

@@ -181,14 +181,13 @@ class Field:
if self.check_for_button_and_execute(screenshot, self.reset_confirm): if self.check_for_button_and_execute(screenshot, self.reset_confirm):
cv.waitKey(500) cv.waitKey(500)
self.set_color_order((PURPLE, BLUE, RED, YELLOW, GREEN)) if self.colors_at_standard:
self.reset_counter = 0 self.set_color_order((PURPLE, BLUE, RED, YELLOW, GREEN))
self.colors_at_standard = False self.colors_at_standard = False
return else:
else:
if not self.colors_at_standard:
self.set_color_order((GREEN, YELLOW, RED, BLUE, PURPLE)) self.set_color_order((GREEN, YELLOW, RED, BLUE, PURPLE))
self.colors_at_standard = True self.colors_at_standard = True
self.reset_counter = 0
cv.waitKey(500) cv.waitKey(500)
self.find_patterns_and_valid_moves(new_observation) self.find_patterns_and_valid_moves(new_observation)