From 876fc0d29483be759cfdd8210e7d9c70a33f0a09 Mon Sep 17 00:00:00 2001 From: Nathanael Lu Date: Mon, 11 Mar 2024 19:22:25 -0400 Subject: [PATCH] rename target_entity --- clash_royale/envs/game_engine/logic/target.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/clash_royale/envs/game_engine/logic/target.py b/clash_royale/envs/game_engine/logic/target.py index 46a7a6c..3b5c53d 100644 --- a/clash_royale/envs/game_engine/logic/target.py +++ b/clash_royale/envs/game_engine/logic/target.py @@ -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: @@ -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): """