conflict merge

This commit is contained in:
Maciej 2023-05-14 10:15:09 +02:00
parent 236f608830
commit 246fda4e8a

View File

@ -1,3 +1,4 @@
from decisionTree.evaluate import evaluate
from domain.entities.entity import Entity from domain.entities.entity import Entity
@ -16,6 +17,8 @@ class World:
def add_entity(self, entity: Entity): def add_entity(self, entity: Entity):
if entity.type == "PEEL": if entity.type == "PEEL":
self.dust[entity.x][entity.y].append(entity) self.dust[entity.x][entity.y].append(entity)
elif entity.type == "EARRING":
self.dust[entity.x][entity.y].append(entity)
elif entity.type == "VACUUM": elif entity.type == "VACUUM":
self.vacuum = entity self.vacuum = entity
elif entity.type == "DOC_STATION": elif entity.type == "DOC_STATION":
@ -30,7 +33,10 @@ class World:
return bool(self.obstacles[x][y]) return bool(self.obstacles[x][y])
def is_garbage_at(self, x: int, y: int) -> bool: def is_garbage_at(self, x: int, y: int) -> bool:
return bool(self.dust[x][y]) if len(self.dust[x][y]) == 0:
return False
tmp = evaluate([self.dust[x][y][0].props])
return bool(tmp[0])
def is_docking_station_at(self, x: int, y: int) -> bool: def is_docking_station_at(self, x: int, y: int) -> bool:
return bool(self.doc_station.x == x and self.doc_station.y == y) return bool(self.doc_station.x == x and self.doc_station.y == y)