mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-12-11 18:10:38 +01:00
bugfixes
This commit is contained in:
@@ -12,8 +12,6 @@ from ...utils.utility_classes import RenderEntity
|
||||
class Entity(_Object, abc.ABC):
|
||||
"""Full Env Entity that lives on the environment Grid. Doors, Items, DirtPile etc..."""
|
||||
|
||||
_u_idx = defaultdict(lambda: 0)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
return self._status or ActionResult(entity=self, identifier=c.NOOP, validity=c.VALID, reward=0)
|
||||
@@ -29,7 +27,6 @@ class Entity(_Object, abc.ABC):
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
|
||||
@property
|
||||
def var_can_move(self):
|
||||
try:
|
||||
@@ -51,7 +48,6 @@ class Entity(_Object, abc.ABC):
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
|
||||
@property
|
||||
def x(self):
|
||||
return self.pos[0]
|
||||
@@ -87,7 +83,7 @@ class Entity(_Object, abc.ABC):
|
||||
if valid := state.check_move_validity(self, next_pos):
|
||||
for observer in self.observers:
|
||||
observer.notify_del_entity(self)
|
||||
self._view_directory = curr_pos[0]-next_pos[0], curr_pos[1]-next_pos[1]
|
||||
self._view_directory = curr_pos[0] - next_pos[0], curr_pos[1] - next_pos[1]
|
||||
self._pos = next_pos
|
||||
for observer in self.observers:
|
||||
observer.notify_add_entity(self)
|
||||
|
||||
Reference in New Issue
Block a user