Madra_smieciarka/classes/Trashcan.py

53 lines
1.2 KiB
Python
Raw Normal View History

class Trashcan:
def __init__(self, mult):
self.mult = mult
2024-03-19 18:52:31 +01:00
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 self.mult*x, self.mult*y
2024-03-19 18:52:31 +01:00
def generateTrashcan(mult, newId, image, position, trashtype):
2024-03-19 18:52:31 +01:00
"""
:param int newId:
:param string image:
:param tuple position:
:param string trashtype:
:return object Trashcan:
"""
trash = Trashcan(mult)
2024-03-19 18:52:31 +01:00
trash.setId(newId).setImage(image).setPosition(position).setTrashtype(trashtype)
return trash