added changes from code submission branch and coin entity

This commit is contained in:
Chanumask
2024-09-06 11:01:42 +02:00
parent 33e40deecf
commit 5476f617c6
42 changed files with 1429 additions and 68 deletions

View File

@@ -118,9 +118,8 @@ class Gamestate(object):
self._floortile_graph = None
self.tests = StepTests(*tests)
# Pointer that defines current spawn points of agents
for agent in self.agents_conf:
self.agents_conf[agent]["pos_pointer"] = 0
# Initialize position pointers for agents
self._initialize_position_pointers()
def reset(self):
self.curr_step = 0
@@ -138,6 +137,11 @@ class Gamestate(object):
def __repr__(self):
return f'{self.__class__.__name__}({len(self.entities)} Entitites @ Step {self.curr_step})'
def _initialize_position_pointers(self):
""" Initialize the position pointers for each agent in the configuration."""
for agent in self.agents_conf:
self.agents_conf[agent]["pos_pointer"] = 0
@property
def random_free_position(self) -> (int, int):
"""