2024-03-25 11:21:23 +01:00
|
|
|
from classes.Garbage import *
|
|
|
|
|
|
|
|
|
2024-03-18 23:43:26 +01:00
|
|
|
class Household:
|
2024-04-11 13:55:55 +02:00
|
|
|
def __init__(self, mult):
|
|
|
|
self.mult = mult
|
2024-03-19 18:52:31 +01:00
|
|
|
self.id: int = 0
|
|
|
|
self.image: object = None
|
|
|
|
self.position: tuple = None
|
2024-03-25 11:21:23 +01:00
|
|
|
self.garbage: object = Garbage()
|
2024-04-11 13:55:55 +02:00
|
|
|
self.final = False
|
|
|
|
|
|
|
|
def getFinal(self):
|
|
|
|
return self.final
|
|
|
|
|
|
|
|
def switchFinal(self):
|
|
|
|
self.final = False if self.final else True
|
|
|
|
return self
|
2024-03-18 23:43:26 +01:00
|
|
|
|
2024-03-19 18:52:31 +01:00
|
|
|
def setPosition(self, position: tuple):
|
|
|
|
self.position = position
|
2024-03-19 21:08:24 +01:00
|
|
|
return self
|
2024-03-19 18:52:31 +01:00
|
|
|
|
2024-03-18 23:43:26 +01:00
|
|
|
def getPosition(self):
|
|
|
|
return self.position
|
|
|
|
|
2024-03-19 18:52:31 +01:00
|
|
|
def setImage(self, image: object):
|
|
|
|
self.image = image
|
2024-03-19 21:08:24 +01:00
|
|
|
return self
|
2024-03-19 18:52:31 +01:00
|
|
|
|
2024-03-18 23:43:26 +01:00
|
|
|
def getImage(self):
|
|
|
|
return self.image
|
|
|
|
|
2024-03-19 18:52:31 +01:00
|
|
|
def setId(self, newID: int):
|
|
|
|
self.id = newID
|
2024-03-19 21:08:24 +01:00
|
|
|
return self
|
2024-03-19 18:52:31 +01:00
|
|
|
|
2024-03-18 23:43:26 +01:00
|
|
|
def getId(self):
|
2024-03-19 18:52:31 +01:00
|
|
|
return self.id
|
|
|
|
|
|
|
|
def setGarbage(self, garbage: object):
|
|
|
|
self.garbage = garbage
|
2024-03-19 21:08:24 +01:00
|
|
|
return self
|
2024-03-19 18:52:31 +01:00
|
|
|
|
|
|
|
def getGarbage(self):
|
|
|
|
return self.garbage
|
2024-03-19 21:08:24 +01:00
|
|
|
|
2024-03-25 14:26:41 +01:00
|
|
|
def printme(self):
|
|
|
|
x, y = self.getPosition()
|
2024-04-11 13:55:55 +02:00
|
|
|
return self.mult*x, self.mult*y
|
2024-03-25 14:26:41 +01:00
|
|
|
|
2024-03-19 21:08:24 +01:00
|
|
|
|
2024-04-11 13:55:55 +02:00
|
|
|
def generateHousehold(mult, i, image, position):
|
2024-03-19 21:08:24 +01:00
|
|
|
"""
|
|
|
|
:param int i:
|
|
|
|
:param object image:
|
|
|
|
:param tuple position:
|
|
|
|
:return:
|
|
|
|
"""
|
2024-04-11 13:55:55 +02:00
|
|
|
house = Household(mult)
|
2024-03-19 21:08:24 +01:00
|
|
|
house.setId(i).setImage(image).setPosition(position)
|
|
|
|
return house
|