Madra_smieciarka/classes/Trashcan.py
Neerka e02adf16b6 grid works + little adjustments
Signed-off-by: Neerka <jakub.markil1@gmail.com>
2024-03-25 14:26:41 +01:00

52 lines
1.1 KiB
Python

class Trashcan:
def __init__(self):
self.id: int = 0
self.image: object = None
self.position: tuple = None
self.trashtype: str = None
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 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
def printme(self):
x, y = self.getPosition()
return 32*x, 32*y
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