Madra_smieciarka/QOLfunc.py
2024-03-25 11:21:23 +01:00

25 lines
574 B
Python

# Tutaj wrzucam jakieś funkcje różne, co by nie zaśmiecać tym maina jak nie trzeba
from classes.Household import *
colors = {
"white": (255, 255, 255),
"black": (0, 0, 0),
"red": (255, 0, 0)
}
def extractPredicts(houses: list) -> set:
preds = set()
for house in houses:
temp = [house, house.getGarbage().getPredict()]
preds.add(temp)
return preds
def distance(object1, object2) -> int:
lok1 = object1.getPosition()
lok2 = object2.getPosition()
dist = abs(lok1[0]-lok2[0]) + abs(lok1[1]-lok2[1])
return dist