Madra_smieciarka/classes/Trashcan.py
Neerka 3d8c1c0641 movement done
Signed-off-by: Neerka <kuba.markil0220@gmail.com>
2024-04-13 14:09:40 +02:00

61 lines
1.4 KiB
Python

class Trashcan:
def __init__(self, mult):
self.mult = mult
self.id: int = 0
self.image: object = None
self.position: tuple = None
self.trashtype: str = None
self.final = False
def getFinal(self):
return self.final
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 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 self.mult*x, self.mult*y
def generateTrashcan(mult, newId, image, position, trashtype):
"""
:param int newId:
:param string image:
:param tuple position:
:param string trashtype:
:return object Trashcan:
"""
trash = Trashcan(mult)
trash.setId(newId).setImage(image).setPosition(position).setTrashtype(trashtype)
return trash