Madra_smieciarka/classes/Household.py
Neerka 8c37aaea5d tree complete
Signed-off-by: Neerka <kuba.markil0220@gmail.com>
2024-05-13 15:05:11 +02:00

73 lines
1.5 KiB
Python

import random
from classes.Garbage import *
class Household:
def __init__(self, mult):
self.paid = random.randint(0, 1)
self.lastTaken = random.randint(0, 30)
self.mult = mult
self.id: int = 0
self.image: object = None
self.position: tuple = None
self.garbage: object = Garbage()
self.final = False
def getFinal(self):
return self.final
def getPaid(self):
return self.paid
def getLastTaken(self):
return self.lastTaken
def switchFinal(self):
self.final = False if self.final else True
return self
def setPosition(self, position: tuple):
self.position = position
return self
def getPosition(self):
return self.position
def setImage(self, image: object):
self.image = image
return self
def getImage(self):
return self.image
def setId(self, newID: int):
self.id = newID
return self
def getId(self):
return self.id
def setGarbage(self, garbage: object):
self.garbage = garbage
return self
def getGarbage(self):
return self.garbage
def printme(self):
x, y = self.getPosition()
return self.mult*x, self.mult*y
def generateHousehold(mult, i, image, position):
"""
:param int i:
:param object image:
:param tuple position:
:return:
"""
house = Household(mult)
house.setId(i).setImage(image).setPosition(position)
return house