30 lines
679 B
Python
30 lines
679 B
Python
class Trashcan:
|
|
def __init__(self, id, image, position, trashtype):
|
|
self.id = id
|
|
self.image = image
|
|
assert isinstance(position, tuple)
|
|
self.position = position
|
|
self.type = trashtype
|
|
self.neighbours = []
|
|
|
|
def setNeighbours(self, neighbours):
|
|
self.neighbours = neighbours
|
|
|
|
def addNeighbour(self, neighbour):
|
|
self.neighbours.append(neighbour)
|
|
|
|
def getNeighbours(self):
|
|
return self.neighbours
|
|
|
|
def getPosition(self):
|
|
return self.position
|
|
|
|
def getImage(self):
|
|
return self.image
|
|
|
|
def getType(self):
|
|
return self.type
|
|
|
|
def getId(self):
|
|
return self.id
|