Madra_smieciarka/classes/Trashcan.py

52 lines
1.1 KiB
Python
Raw Normal View History

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-19 18:52:31 +01:00
def setPosition(self, position: tuple):
self.position = position
return self
def getPosition(self):
return self.position
2024-03-19 18:52:31 +01:00
def setImage(self, image: object):
self.image = image
return self
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
def getId(self):
return self.id
2024-03-19 18:52:31 +01:00
def printme(self):
x, y = self.getPosition()
return 32*x, 32*y
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