Merge branch 'main' into refactor_rename

# Conflicts:
#	marl_factory_grid/environment/entity/entity.py
#	marl_factory_grid/modules/destinations/entitites.py
#	marl_factory_grid/modules/doors/entitites.py
#	marl_factory_grid/modules/items/groups.py
This commit is contained in:
Chanumask
2023-10-20 15:39:01 +02:00
41 changed files with 267 additions and 215 deletions

View File

@ -8,7 +8,7 @@ from ...environment.entity.entity import Entity
from ..doors import constants as do
from ..maintenance import constants as mi
from ...utils.helpers import MOVEMAP
from ...utils.render import RenderEntity
from ...utils.utility_classes import RenderEntity
from ...utils.states import Gamestate
@ -39,7 +39,7 @@ class Maintainer(Entity):
self._next = []
self._last = []
self._last_serviced = 'None'
self._floortile_graph = points_to_graph(state[c.FLOORS].positions)
self._floortile_graph = points_to_graph(state.entities.floorlist)
def tick(self, state):
if found_objective := state[self.objective].by_pos(self.pos):

View File

@ -14,7 +14,8 @@ class MaintenanceRule(Rule):
self.n_maintainer = n_maintainer
def on_init(self, state: Gamestate, lvl_map):
state[M.MAINTAINERS].spawn(state[c.FLOORS].empty_tiles[:self.n_maintainer], state)
# Move to spawn? : #TODO
state[M.MAINTAINERS].spawn(state.entities.empty_positions[:self.n_maintainer], state)
pass
def tick_pre_step(self, state) -> List[TickResult]: