From b2e61b868ab1677c176e6ac2e1a96b61057a2a85 Mon Sep 17 00:00:00 2001 From: Ahmad Abu-Aysha Date: Fri, 25 Aug 2023 13:33:18 +1000 Subject: [PATCH] updated comments --- .../csse3200/game/components/tasks/TowerIdleTask.java | 9 ++++++++- .../game/components/tower/TowerAnimationController.java | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/TowerIdleTask.java b/source/core/src/main/com/csse3200/game/components/tasks/TowerIdleTask.java index 636f079e3..0120b1610 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/TowerIdleTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/TowerIdleTask.java @@ -18,6 +18,10 @@ * Task for the Tower Idle State - specifically for the * Weapon Tower Entity that can move between combat and * idle states. Scans for enemy mobs but does nothing else. + * + * ====================== CURRENTLY NOT IN USE ================================== + * This task may be modified for use in future features but is not required + * for current functionality */ public class TowerIdleTask extends DefaultTask implements PriorityTask { private static final Logger logger = LoggerFactory.getLogger(MovementTask.class); @@ -34,6 +38,8 @@ public class TowerIdleTask extends DefaultTask implements PriorityTask { private final short TARGET = PhysicsLayer.NPC; /** + * Instantiates a TowerIdleTask which scans for mobs at a certain + * time interval. * @param interval time between scanning for mobs, in seconds. */ public TowerIdleTask(float interval) { @@ -45,11 +51,12 @@ public TowerIdleTask(float interval) { } /** - * Start waiting from now until interval has passed. + * Start the Idle task - waiting from current game time until interval has passed. */ @Override public void start() { super.start(); + // Trigger the idle event owner.getEntity().getEvents().trigger("idleStart"); endTime = timeSource.getTime() + (int)(this.interval * 1000); } diff --git a/source/core/src/main/com/csse3200/game/components/tower/TowerAnimationController.java b/source/core/src/main/com/csse3200/game/components/tower/TowerAnimationController.java index 07f9dcee2..cddb893be 100644 --- a/source/core/src/main/com/csse3200/game/components/tower/TowerAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/tower/TowerAnimationController.java @@ -4,8 +4,8 @@ import com.csse3200.game.rendering.AnimationRenderComponent; /** - * This class listens to events relevant to a weapon tower state and plays the animation when one - * of the events is triggered. + * Listens for events relevant to a weapon tower state. + * Each event will trigger a certain animation */ public class TowerAnimationController extends Component { AnimationRenderComponent animator;