From 75e3b13eae980d4c6357028aaa517a0f5973c07d Mon Sep 17 00:00:00 2001 From: MiniSoda17 Date: Tue, 17 Oct 2023 09:40:35 +1000 Subject: [PATCH] Fixing code smells in all animation controllers --- .../components/npc/ArcaneArcherAnimationController.java | 7 +------ .../game/components/npc/CoatAnimationController.java | 6 ------ .../components/npc/DragonKnightAnimationController.java | 6 ------ .../game/components/npc/FireWormAnimationController.java | 6 ------ .../game/components/npc/FirewizardAnimationController.java | 3 --- .../components/npc/NecromancerAnimationController.java | 4 ---- .../game/components/npc/NightBorneAnimationController.java | 5 +---- .../game/components/npc/RockyAnimationController.java | 3 --- .../game/components/npc/SkeletonAnimationController.java | 6 ------ .../game/components/npc/WaterQueenAnimationController.java | 6 ------ .../game/components/npc/WaterSlimeAnimationController.java | 6 ------ .../game/components/npc/WizardAnimationController.java | 6 ------ 12 files changed, 2 insertions(+), 62 deletions(-) diff --git a/source/core/src/main/com/csse3200/game/components/npc/ArcaneArcherAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/ArcaneArcherAnimationController.java index 71fa5359d..82c587f18 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/ArcaneArcherAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/ArcaneArcherAnimationController.java @@ -5,19 +5,14 @@ import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.services.ServiceLocator; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class ArcaneArcherAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); + AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); private static final String ATTACK_SOUND = "sounds/mobs/archerArrow.mp3"; Sound attackSound = ServiceLocator.getResourceService().getAsset( diff --git a/source/core/src/main/com/csse3200/game/components/npc/CoatAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/CoatAnimationController.java index e9bf8170e..c023e0aa5 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/CoatAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/CoatAnimationController.java @@ -5,19 +5,13 @@ import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.services.ServiceLocator; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class CoatAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); private static final String ATTACK_SOUND = "sounds/mobs/coatAttack.mp3"; Sound attackSound = ServiceLocator.getResourceService().getAsset( diff --git a/source/core/src/main/com/csse3200/game/components/npc/DragonKnightAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/DragonKnightAnimationController.java index 6d9d54215..7302a1cdc 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/DragonKnightAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/DragonKnightAnimationController.java @@ -2,19 +2,13 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class DragonKnightAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); @Override public void create() { diff --git a/source/core/src/main/com/csse3200/game/components/npc/FireWormAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/FireWormAnimationController.java index 141d43d69..28d118210 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/FireWormAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/FireWormAnimationController.java @@ -4,19 +4,13 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.services.ServiceLocator; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class FireWormAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); private static final String ATTACK_SOUND = "sounds/mobs/fireWormRoar.mp3"; Sound attackSound = ServiceLocator.getResourceService().getAsset( diff --git a/source/core/src/main/com/csse3200/game/components/npc/FirewizardAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/FirewizardAnimationController.java index 267c23404..b10236761 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/FirewizardAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/FirewizardAnimationController.java @@ -3,12 +3,9 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import java.security.SecureRandom; - public class FirewizardAnimationController extends Component { AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); @Override diff --git a/source/core/src/main/com/csse3200/game/components/npc/NecromancerAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/NecromancerAnimationController.java index 3bdad9407..dfbd4bc9a 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/NecromancerAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/NecromancerAnimationController.java @@ -3,13 +3,9 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import java.security.SecureRandom; - public class NecromancerAnimationController extends Component { AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); - @Override public void create() { diff --git a/source/core/src/main/com/csse3200/game/components/npc/NightBorneAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/NightBorneAnimationController.java index d821f6cca..fccdfe580 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/NightBorneAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/NightBorneAnimationController.java @@ -2,7 +2,6 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one @@ -13,9 +12,7 @@ public class NightBorneAnimationController extends Component { // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( // COLLISION_SFX, Sound.class); - AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); - + AnimationRenderComponent animator; @Override public void create() { diff --git a/source/core/src/main/com/csse3200/game/components/npc/RockyAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/RockyAnimationController.java index f6743dd9d..63f850085 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/RockyAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/RockyAnimationController.java @@ -3,11 +3,8 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import java.security.SecureRandom; - public class RockyAnimationController extends Component { AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); @Override diff --git a/source/core/src/main/com/csse3200/game/components/npc/SkeletonAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/SkeletonAnimationController.java index d5ea57bfa..7a821ef75 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/SkeletonAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/SkeletonAnimationController.java @@ -4,19 +4,13 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.services.ServiceLocator; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class SkeletonAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); /** Sound variables */ private static final String ATTACK_SOUND = "sounds/mobs/boneBreak.mp3"; diff --git a/source/core/src/main/com/csse3200/game/components/npc/WaterQueenAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/WaterQueenAnimationController.java index 0b8a00b75..294f312b1 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/WaterQueenAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/WaterQueenAnimationController.java @@ -4,19 +4,13 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.services.ServiceLocator; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class WaterQueenAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); private static final String ATTACK_SOUND = "sounds/mobs/waterQueenSpell.mp3"; Sound attackSound = ServiceLocator.getResourceService().getAsset( diff --git a/source/core/src/main/com/csse3200/game/components/npc/WaterSlimeAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/WaterSlimeAnimationController.java index 6909dad10..52163ddcb 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/WaterSlimeAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/WaterSlimeAnimationController.java @@ -2,19 +2,13 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class WaterSlimeAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); @Override public void create() { diff --git a/source/core/src/main/com/csse3200/game/components/npc/WizardAnimationController.java b/source/core/src/main/com/csse3200/game/components/npc/WizardAnimationController.java index c8c8e7073..80623d6db 100644 --- a/source/core/src/main/com/csse3200/game/components/npc/WizardAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/npc/WizardAnimationController.java @@ -4,19 +4,13 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; import com.csse3200.game.services.ServiceLocator; -import java.security.SecureRandom; /** * This class listens to events relevant to a ghost entity's state and plays the animation when one * of the events is triggered. */ public class WizardAnimationController extends Component { - // // For on collision sounds later - // private static final String COLLISION_SFX = "sounds/projectiles/on_collision.mp3"; - // Sound onCollisionSound = ServiceLocator.getResourceService().getAsset( - // COLLISION_SFX, Sound.class); AnimationRenderComponent animator; - private SecureRandom rand = new SecureRandom(); /** Sound variables */ private static final String ATTACK_SOUND = "sounds/mobs/wizardSpell.mp3";