1
0
mirror of https://github.com/illiumst/marl-factory-grid.git synced 2026-04-24 07:47:32 +02:00
Files
marl-factory-grid/marl_factory_grid/environment/groups/walls.py
T

26 lines
719 B
Python

from marl_factory_grid.environment import constants as c
from marl_factory_grid.environment.entity.wall import Wall
from marl_factory_grid.environment.groups.collection import Collection
class Walls(Collection):
_entity = Wall
symbol = c.SYMBOL_WALL
var_can_collide = True
var_is_blocking_light = True
var_can_move = False
var_has_position = True
var_can_be_bound = False
var_is_blocking_pos = True
def __init__(self, *args, **kwargs):
super(Walls, self).__init__(*args, **kwargs)
self._value = c.VALUE_OCCUPIED_CELL
def by_pos(self, pos: (int, int)):
try:
return super().by_pos(pos)[0]
except IndexError:
return None