From ac18f3f2ccf843ca3e0c24d3971cc967ec80edfb Mon Sep 17 00:00:00 2001 From: Semjon Kerner Date: Fri, 7 May 2021 15:16:21 +0200 Subject: [PATCH] fixupfixup enum-dict --- fishy/engine/semifisher/fishing_mode.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fishy/engine/semifisher/fishing_mode.py b/fishy/engine/semifisher/fishing_mode.py index c78230e..4049dfe 100644 --- a/fishy/engine/semifisher/fishing_mode.py +++ b/fishy/engine/semifisher/fishing_mode.py @@ -18,17 +18,17 @@ class State(Enum): DEAD = 15 Colors = { - "IDLE" : [255, 255, 255], - "LOOKAWAY" : [ 76, 0, 76], - "LOOKING" : [101, 69, 0], - "DEPLETED" : [ 0, 76, 76], - "NOBAIT" : [255, 204, 0], - "FISHING" : [ 75, 156, 213], - "REELIN" : [ 0, 204, 0], - "LOOT" : [ 0, 0, 204], - "INVFULL" : [ 0, 0, 51], - "FIGHT" : [204, 0, 0], - "DEAD" : [ 51, 51, 51] + State.IDLE : [255, 255, 255], + State.LOOKAWAY : [ 76, 0, 76], + State.LOOKING : [101, 69, 0], + State.DEPLETED : [ 0, 76, 76], + State.NOBAIT : [255, 204, 0], + State.FISHING : [ 75, 156, 213], + State.REELIN : [ 0, 204, 0], + State.LOOT : [ 0, 0, 204], + State.INVFULL : [ 0, 0, 51], + State.FIGHT : [204, 0, 0], + State.DEAD : [ 51, 51, 51] } @@ -51,7 +51,7 @@ def loop(rgb): """ FishingMode.CurrentMode = State.IDLE for s in State: - if all(rgb == Colors[s.name]): + if all(rgb == Colors[s]): FishingMode.CurrentMode = s if FishingMode.CurrentMode != FishingMode.PrevMode: