Madra_smieciarka/classes/Household.py

50 lines
1017 B
Python
Raw Normal View History

2024-03-25 11:21:23 +01:00
from classes.Garbage import *
class Household:
2024-03-19 18:52:31 +01:00
def __init__(self):
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-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
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
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
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
def generateHousehold(i, image, position):
"""
:param int i:
:param object image:
:param tuple position:
:return:
"""
house = Household()
house.setId(i).setImage(image).setPosition(position)
return house