tile cost fix

This commit is contained in:
Mateusz Dokowicz 2023-05-25 16:25:37 +02:00
parent 3dcd5db03d
commit 991dd93650
1 changed files with 4 additions and 3 deletions

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]