2024-03-18 23:43:26 +01:00
|
|
|
class Trashcan:
|
2024-03-19 18:52:31 +01:00
|
|
|
def __init__(self):
|
|
|
|
self.id: int = 0
|
|
|
|
self.image: object = None
|
|
|
|
self.position: tuple = None
|
|
|
|
self.trashtype: str = None
|
2024-03-18 23:43:26 +01:00
|
|
|
|
2024-03-19 18:52:31 +01:00
|
|
|
def setPosition(self, position: tuple):
|
|
|
|
self.position = position
|
|
|
|
return self
|
|
|
|
|
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
|
|
|
|
return self
|
|
|
|
|
2024-03-18 23:43:26 +01:00
|
|
|
def getImage(self):
|
|
|
|
return self.image
|
|
|
|
|
2024-03-19 18:52:31 +01:00
|
|
|
def setTrashtype(self, trashtype: str):
|
|
|
|
self.trashtype = trashtype
|
|
|
|
return self
|
|
|
|
|
|
|
|
def getTrashtype(self):
|
|
|
|
return self.trashtype
|
|
|
|
|
|
|
|
def setId(self, newId: int):
|
|
|
|
self.id = newId
|
|
|
|
return self
|
2024-03-18 23:43:26 +01:00
|
|
|
|
|
|
|
def getId(self):
|
|
|
|
return self.id
|
2024-03-19 18:52:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
def generateTrashcan(newId, image, position, trashtype):
|
|
|
|
"""
|
|
|
|
:param int newId:
|
|
|
|
:param string image:
|
|
|
|
:param tuple position:
|
|
|
|
:param string trashtype:
|
|
|
|
:return object Trashcan:
|
|
|
|
"""
|
|
|
|
trash = Trashcan()
|
|
|
|
trash.setId(newId).setImage(image).setPosition(position).setTrashtype(trashtype)
|
|
|
|
return trash
|