refactoring to game base class

This commit is contained in:
2022-10-17 17:11:56 +02:00
parent 433170b4c8
commit 14a5983d17
22 changed files with 47 additions and 422 deletions

View File

@@ -1,13 +1,11 @@
import random
from operator import itemgetter
from time import time
from window_capture import WindowCapture
from vision import Vision
import cv2 as cv
from hsvfilter import HsvFilter
from config_file import UserConfigs
import pydirectinput
from utils import dig_point
from game_base_class import GameBase
EMITTER_MAIN = "main"
EMITTER_MUSH = "mushroom"
@@ -21,11 +19,10 @@ EMITTER_MULTI = "multi"
HSV_DEFAULT = HsvFilter(0, 0, 0, 179, 255, 255, 0, 0, 0, 0)
class Equipment:
class Equipment(GameBase):
def __init__(self, overlay):
self.overlay = overlay
self.config = UserConfigs()
super().__init__(overlay)
self.needles = []
self.hsvs = []
@@ -37,12 +34,6 @@ class Equipment:
self.SPAWN_COUNT = int(overlay.spawn_use.get())
self.ENERGY_TO_USE = int(overlay.energy_use.get())
# initialize the StunWindowCapture class
self.capture_window = WindowCapture(None, "equip", self.config)
# initialize the StunVision class
self.vision_stun = Vision()
if self.EMITTER_TO_USE == EMITTER_MULTI:
self.emitters.append(EMITTER_RING)
self.emitters.append(EMITTER_WAND)