From f213aef6988c543dbb2e6682d91894049db21aba Mon Sep 17 00:00:00 2001 From: Nhat Minh Le Date: Tue, 12 Sep 2023 03:52:08 +1000 Subject: [PATCH] Change Final Boss's files --- .../{FinalBossMovementTask.java => FinalBossTask.java} | 6 +++--- .../csse3200/game/entities/factories/BossKingFactory.java | 6 ++---- ...inalBossMovementTaskTest.java => FinalBossTaskTest.java} | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) rename source/core/src/main/com/csse3200/game/components/tasks/{FinalBossMovementTask.java => FinalBossTask.java} (96%) rename source/core/src/test/com/csse3200/game/components/tasks/{FinalBossMovementTaskTest.java => FinalBossTaskTest.java} (93%) diff --git a/source/core/src/main/com/csse3200/game/components/tasks/FinalBossMovementTask.java b/source/core/src/main/com/csse3200/game/components/tasks/FinalBossTask.java similarity index 96% rename from source/core/src/main/com/csse3200/game/components/tasks/FinalBossMovementTask.java rename to source/core/src/main/com/csse3200/game/components/tasks/FinalBossTask.java index db79168a7..9d358597e 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/FinalBossMovementTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/FinalBossTask.java @@ -19,8 +19,8 @@ * Wander around by moving a random position within a range of the starting position. Wait a little * bit between movements. Requires an entity with a PhysicsMovementComponent. */ -public class FinalBossMovementTask extends DefaultTask implements PriorityTask { - private static final Logger logger = LoggerFactory.getLogger(FinalBossMovementTask.class); +public class FinalBossTask extends DefaultTask implements PriorityTask { + private static final Logger logger = LoggerFactory.getLogger(FinalBossTask.class); private final float waitTime; private int currLane; @@ -36,7 +36,7 @@ public class FinalBossMovementTask extends DefaultTask implements PriorityTask { /** * @param waitTime How long in seconds to wait between moving. */ - public FinalBossMovementTask(float waitTime, int numLane) { + public FinalBossTask(float waitTime, int numLane) { this.waitTime = waitTime; this.currLane = numLane; diff --git a/source/core/src/main/com/csse3200/game/entities/factories/BossKingFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/BossKingFactory.java index fcd3146d4..502a30c62 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/BossKingFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/BossKingFactory.java @@ -1,12 +1,11 @@ package com.csse3200.game.entities.factories; -import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.csse3200.game.ai.tasks.AITaskComponent; import com.csse3200.game.components.*; import com.csse3200.game.components.npc.BossAnimationController; -import com.csse3200.game.components.tasks.FinalBossMovementTask; +import com.csse3200.game.components.tasks.FinalBossTask; import com.csse3200.game.components.tasks.RangeBossTask; import com.csse3200.game.entities.Entity; import com.csse3200.game.entities.configs.BossKingConfigs; @@ -16,7 +15,6 @@ import com.csse3200.game.physics.PhysicsUtils; import com.csse3200.game.physics.components.*; import com.csse3200.game.rendering.AnimationRenderComponent; -import com.csse3200.game.rendering.TextureRenderComponent; import com.csse3200.game.services.ServiceLocator; public class BossKingFactory { @@ -30,7 +28,7 @@ public static Entity createBossKing1(Entity target, int numLane) { BossKingConfigs config = configs.BossKing; Entity bossKing1 = createBaseBoss(target); - AITaskComponent aiTaskComponent1 = new AITaskComponent().addTask(new FinalBossMovementTask(1f, numLane)); + AITaskComponent aiTaskComponent1 = new AITaskComponent().addTask(new FinalBossTask(1f, numLane)); // Animation section AnimationRenderComponent animator1 = new AnimationRenderComponent( diff --git a/source/core/src/test/com/csse3200/game/components/tasks/FinalBossMovementTaskTest.java b/source/core/src/test/com/csse3200/game/components/tasks/FinalBossTaskTest.java similarity index 93% rename from source/core/src/test/com/csse3200/game/components/tasks/FinalBossMovementTaskTest.java rename to source/core/src/test/com/csse3200/game/components/tasks/FinalBossTaskTest.java index 4b723db6c..cceb77262 100644 --- a/source/core/src/test/com/csse3200/game/components/tasks/FinalBossMovementTaskTest.java +++ b/source/core/src/test/com/csse3200/game/components/tasks/FinalBossTaskTest.java @@ -19,7 +19,7 @@ @ExtendWith(GameExtension.class) @ExtendWith(MockitoExtension.class) -class FinalBossMovementTaskTest { +class FinalBossTaskTest { @Mock GameTime gameTime; @@ -31,7 +31,7 @@ void beforeEach() { @Test void shouldTriggerEvent() { - FinalBossMovementTask FBMTask = new FinalBossMovementTask(1f, 2); + FinalBossTask FBMTask = new FinalBossTask(1f, 2); AITaskComponent aiTaskComponent = new AITaskComponent().addTask(FBMTask); Entity entity = new Entity().addComponent(aiTaskComponent).addComponent(new PhysicsMovementComponent());