From 991dd9365047102db059df849356201ab6cef790 Mon Sep 17 00:00:00 2001 From: Mateusz Dokowicz Date: Thu, 25 May 2023 16:25:37 +0200 Subject: [PATCH] tile cost fix --- domain/world.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/domain/world.py b/domain/world.py index fd72812..d3a7e8a 100644 --- a/domain/world.py +++ b/domain/world.py @@ -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] \ No newline at end of file + return self.costs[x][y]