restructured engine

This commit is contained in:
DESKTOP-JVKHS7I\Adam 2020-05-23 10:24:11 +05:30
parent 168e902e36
commit c8510d56cf
11 changed files with 11 additions and 11 deletions

View File

@ -10,7 +10,7 @@ import fishy
from fishy import web, helper, gui
from fishy.gui import GUI
from fishy.helper import Config
from fishy.tech import Engine
from fishy.engine import SemiFisherEngine
# noinspection PyBroadException
@ -53,7 +53,7 @@ def main():
if not gui.check_eula(c):
return
bot = Engine(c, lambda: gui_window)
bot = SemiFisherEngine(c, lambda: gui_window)
gui_window = GUI(c, lambda: bot)
gui_window.start()

2
fishy/engine/__init__.py Normal file
View File

@ -0,0 +1,2 @@
from fishy.engine.semifisher.funcs import SemiFisherFuncs
from fishy.engine.semifisher.engine import SemiFisherEngine

View File

View File

@ -8,8 +8,8 @@ import logging
import pywintypes
from fishy.tech.funcs import EngineFuncs
from . import fishing_event
from fishy.engine.semifisher.funcs import SemiFisherFuncs
from fishy.engine.semifisher import fishing_event
from .fishing_event import HookEvent, StickEvent, LookEvent, IdleEvent
from .fishing_mode import FishingMode
from .pixel_loc import PixelLoc
@ -31,9 +31,9 @@ def _wait_and_check(gui):
"If fixing those doesnt work, try running the bot as admin")
class Engine:
class SemiFisherEngine:
def __init__(self, config, gui_ref: 'Callable[[], GUI]'):
self.funcs = EngineFuncs(self)
self.funcs = SemiFisherFuncs(self)
self.get_gui = gui_ref
self.start = False

View File

@ -3,7 +3,7 @@ from threading import Thread
# noinspection PyProtectedMember
class EngineFuncs:
class SemiFisherFuncs:
def __init__(self, engine):
self.engine = engine

View File

@ -3,14 +3,14 @@ from typing import List, Callable
import threading
from fishy.gui.funcs import GUIFuncs
from fishy.tech import Engine
from fishy.engine import SemiFisherEngine
from . import main_gui
from .log_config import GUIStreamHandler
from fishy.helper import Config
class GUI:
def __init__(self, config: Config, get_engine: Callable[[], Engine]):
def __init__(self, config: Config, get_engine: Callable[[], SemiFisherEngine]):
"""
:param config: used to get and set configuration settings
"""

View File

@ -1,2 +0,0 @@
from .engine import Engine
from .funcs import EngineFuncs