Просмотр исходного кода

perf(module): Optimize the naming of function parameters

huangrunheng 1 год назад
Родитель
Сommit
bf8287e146
2 измененных файлов с 5 добавлено и 5 удалено
  1. 3 3
      module/atom/animate.py
  2. 2 2
      tasks/Exploration/solo.py

+ 3 - 3
module/atom/animate.py

@@ -47,11 +47,11 @@ class RuleAnimate(RuleImage):
     def name(self) -> str:
         return self._name.upper()
 
-    def stable(self, image, refresh_when_stable: bool = False) -> bool:
+    def stable(self, image, refresh_after_stable: bool = False) -> bool:
         """
         用于判断连续的两张截图,的目标区域是否一致
         @param image:
-        @param refresh_when_stable:
+        @param refresh_after_stable:
         @return:
         """
         if self._last_image is None:
@@ -63,7 +63,7 @@ class RuleAnimate(RuleImage):
         self._last_image = self.corp(image, self.roi_front)
 
         if matched:
-            if refresh_when_stable:
+            if refresh_after_stable:
                 self.refresh()
             logger.info(f'Animation Stable @ {self.name}')
             return True

+ 2 - 2
tasks/Exploration/solo.py

@@ -82,7 +82,7 @@ class SoloExploration(BaseExploration):
                     search_fail_cnt = 0
                     if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28\
                         and self.appear(self.I_SWIPE_END))\
-                            or self._match_end.stable(self.device.image, refresh_when_stable=True):
+                            or self._match_end.stable(self.device.image, refresh_after_stable=True):
                         self.quit_explore()
                         continue
                     if self.swipe(self.S_SWIPE_BACKGROUND_RIGHT, interval=3):
@@ -214,7 +214,7 @@ class SoloExploration(BaseExploration):
                     search_fail_cnt = 0
                     if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28\
                         and self.appear(self.I_SWIPE_END))\
-                            or self._match_end.stable(self.device.image, refresh_when_stable=True):
+                            or self._match_end.stable(self.device.image, refresh_after_stable=True):
                         self.quit_explore()
                         continue
                     if self.swipe(self.S_SWIPE_BACKGROUND_RIGHT, interval=4.5):