Usunięto TaskManager.

This commit is contained in:
s444417 2020-04-20 23:21:31 +02:00
parent 8b39625137
commit a3a6c95649

View File

@ -1,25 +0,0 @@
import threading
import time
import random
from src.components.Table import Status
#creates new threads
class TaskManager (threading.Thread):
def __init__(self, drawableManager, menuManager, doRepaintObject):
threading.Thread.__init__(self)
self.__drawableManager = drawableManager
self.__menuManager = menuManager
self.__doRepaintObject = doRepaintObject
#changes the status of a random table from NotReady to Ready
def run(self):
while True:
time.sleep(3)
tables = self.__drawableManager.getTables(Status.NotReady)
if tables != []:
tableIndex = random.randint(0, len(tables) - 1)
table = tables[tableIndex]
table.setStatus(Status.Ready)
table.setOrder(self.__menuManager.generateOrder())
self.__doRepaintObject[0] = True