SZI2019SmieciarzWmi/DataModels/House.py

20 lines
714 B
Python
Raw Normal View History

from DataModels.Cell import Cell
from VowpalWabbit.vowpal_utils import MAP_CONTENT
2019-04-01 15:45:48 +02:00
class House(Cell):
def __init__(self, x, y, max_rubbish, yellow=0, green=0, blue=0):
Cell.__init__(self, x, y, max_rubbish, yellow, green, blue)
2019-04-23 21:45:16 +02:00
self.unvisited = True
2019-04-01 15:45:48 +02:00
def return_trash(self, collector):
self.container.yellow, self.container.green, self.container.blue = collector.container.add(
[self.container.yellow, self.container.green, self.container.blue])
2019-04-01 15:45:48 +02:00
self.update_image()
def Visit(self):
self.unvisited = not self.unvisited
if self.unvisited:
MAP_CONTENT[self.y][self.x] = "H"
else:
MAP_CONTENT[self.y][self.x] = "V"