fixing-Errors #24

Merged
s473555 merged 10 commits from fixing-Errors into main 2023-05-29 09:13:00 +02:00
Showing only changes of commit 991dd93650 - Show all commits

View File

@ -4,7 +4,7 @@ from domain.entities.entity import Entity
class World:
def __init__(self, width: int, height: int) -> object:
self.costs = [[1000 for j in range(height)] for i in range(width)]
self.costs = [[1 for j in range(height)] for i in range(width)]
self.width = width
self.height = height
self.dust = [[[] for j in range(height)] for i in range(width)]
@ -35,7 +35,7 @@ class World:
def is_garbage_at(self, x: int, y: int):
if len(self.dust[x][y]) == 0:
return []
return [i for i in self.dust[x][y] if evaluate([i.props])[0] == 1]
return [i for i in self.dust[x][y] if evaluate([i.properties])[0] == 1]
def is_docking_station_at(self, x: int, y: int) -> bool:
return bool(self.doc_station.x == x and self.doc_station.y == y)
@ -53,5 +53,6 @@ class World:
return False
return True
def get_cost(self, x, y):
return self.costs[x][y]
return self.costs[x][y]