tile cost fix
This commit is contained in:
parent
3dcd5db03d
commit
991dd93650
@ -4,7 +4,7 @@ from domain.entities.entity import Entity
|
|||||||
|
|
||||||
class World:
|
class World:
|
||||||
def __init__(self, width: int, height: int) -> object:
|
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.width = width
|
||||||
self.height = height
|
self.height = height
|
||||||
self.dust = [[[] for j in range(height)] for i in range(width)]
|
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):
|
def is_garbage_at(self, x: int, y: int):
|
||||||
if len(self.dust[x][y]) == 0:
|
if len(self.dust[x][y]) == 0:
|
||||||
return []
|
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:
|
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)
|
||||||
@ -53,5 +53,6 @@ class World:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def get_cost(self, x, y):
|
def get_cost(self, x, y):
|
||||||
return self.costs[x][y]
|
return self.costs[x][y]
|
Loading…
Reference in New Issue
Block a user