Skip to content

Commit

Permalink
fixed mod->entity artifacts, fixed entities spelling error
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 11, 2024
1 parent d12e8b5 commit 4a4982b
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions clash_royale/envs/game_engine/entities/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,19 +450,19 @@ def stop(self):

return

def _load_entity(self, mod: Entity) -> None:
def _load_entity(self, entity: Entity) -> None:
"""
Adds the entity to our collection.
This low-level method is not intended to
be worked with by end users!
:param mod: entity to add
:param entity: entity to add
:type mod: Entity
"""

# Create the data to be stored:
self.entities.append(mod)
self.entities.append(entity)

# Update our stats:

Expand All @@ -473,30 +473,21 @@ def _load_entity(self, mod: Entity) -> None:

mod.collection = self

def _unload_entity(self, mod: Entity):
def _unload_entity(self, entity: Entity):
"""
Low-level method for unloading entitys from the list.
Low-level method for unloading entities from the list.
We do not call any methods or work with the entity in any way
other than removing it from the data structure.
:param mod: The entity in question to remove
:type mod: Baseentity
:param entity: The entity in question to remove
:type entity: Entity
:param key: Key of the entity to remove
:type key: str
"""

# Convert the tuple into a list:

temp = list(self.entitys)

# Remove the offending entity:

temp.remove(mod)

# Set our list:

self.entitys = tuple(temp)
self.entities.remove(entity)

# Update our stats:

Expand Down

0 comments on commit 4a4982b

Please sign in to comment.