Skip to content

Commit

Permalink
rename target_entity
Browse files Browse the repository at this point in the history
  • Loading branch information
lunathanael committed Mar 11, 2024
1 parent ca03d75 commit 876fc0d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions clash_royale/envs/game_engine/logic/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from clash_royale.envs.game_engine.utils import distance

if TYPE_CHECKING:
# Only import for typechecking to prevent circular dependency
from clash_royale.envs.game_engine.entities.logic_entity import LogicEntity

class BaseTarget:
Expand All @@ -21,21 +22,21 @@ class BaseTarget:
"""

def __init__(self) -> None:

self.arena: Arena # Arena component to consider
self.entity: LogicEntity # Entity we are attached to

def entity_distance(self, tentity: Entity) -> float:
def entity_distance(self, target_entity: Entity) -> float:
"""
Determines the distance between an entity and ourselves.
:param tentity: Entity to determine distance
:type tentity: Entity
:param target_entity: Entity to determine distance
:type target_entity: Entity
:return: Distance between entities
:rtype: float
"""

return distance(self.entity.x, self.entity.y, tentity.x, tentity.y)
return distance(self.entity.x, self.entity.y, target_entity.x, target_entity.y)

def target(self):
"""
Expand Down

0 comments on commit 876fc0d

Please sign in to comment.