fishyboteso/fishy/engine/common/IEngine.py

34 lines
645 B
Python
Raw Normal View History

2020-06-01 12:58:18 +00:00
import typing
from abc import ABC, abstractmethod
from threading import Thread
from typing import Callable
2020-10-17 19:06:07 +00:00
from fishy.gui.funcs import GUIFuncsMock
2020-06-01 12:58:18 +00:00
if typing.TYPE_CHECKING:
from fishy.gui import GUI
class IEngine(ABC):
2020-10-17 19:06:07 +00:00
def __init__(self, gui_ref: 'Callable[[], GUI]'):
2020-06-01 12:58:18 +00:00
self.get_gui = gui_ref
self.start = False
self.window = None
2020-06-01 12:58:18 +00:00
self.thread = None
@property
def gui(self):
if self.get_gui is None:
return GUIFuncsMock()
2020-06-01 12:58:18 +00:00
return self.get_gui().funcs
@abstractmethod
2020-06-01 12:58:18 +00:00
def toggle_start(self):
...
2020-06-01 12:58:18 +00:00
@abstractmethod
def run(self):
...