Skip to content

Commit

Permalink
fixed some code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamad11Dab committed Sep 10, 2023
1 parent f224f40 commit d61f074
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import com.csse3200.game.ai.tasks.DefaultTask;
import com.csse3200.game.ai.tasks.PriorityTask;
import com.csse3200.game.components.CombatStatsComponent;
import com.csse3200.game.components.ProjectileEffects;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.factories.ProjectileFactory;
import com.csse3200.game.physics.PhysicsEngine;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.raycast.RaycastHit;
Expand Down Expand Up @@ -166,7 +163,6 @@ public void updateTowerState() {
@Override
public void stop() {
super.stop();
// owner.getEntity().getEvents().trigger(STOW);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.badlogic.gdx.math.Vector2;
import com.csse3200.game.ai.tasks.DefaultTask;
import com.csse3200.game.ai.tasks.PriorityTask;
import com.csse3200.game.entities.Entity;
import com.csse3200.game.entities.EntityService;
import com.csse3200.game.physics.PhysicsEngine;
import com.csse3200.game.physics.PhysicsLayer;
import com.csse3200.game.physics.raycast.RaycastHit;
Expand Down Expand Up @@ -144,24 +142,6 @@ public STATE getState() {
return this.towerState;
}

/**
* Fetches the active priority of the Task if a target is visible.
* @return (int) active priority if a target is visible, -1 otherwise
*/
private int getActivePriority() {

return !isTargetVisible() ? 0 : priority;
}

/**
* Fetches the inactive priority of the Task if a target is not visible.
* @return (int) -1 if a target is not visible, active priority otherwise
*/
private int getInactivePriority() {

return isTargetVisible() ? priority : 0;
}

/**
* Uses a raycast to determine whether there are any targets in detection range
* @return true if a target is visible, false otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* Utilizes HitboxComponent and CombatStatsComponent for functionality.
*/
public class TNTDamageComponent extends Component {
private static final Logger logger = LoggerFactory.getLogger(TNTDamageComponent.class);
private short targetLayer;
private float knockbackForce = 0f;
private float radius;
Expand Down Expand Up @@ -84,12 +83,7 @@ private void applyTNTDamage() {

// Check for null components and log specifics
if (sourceHitbox == null || otherHitbox == null) {
if (sourceHitbox == null) {
logger.debug("Warning: Source Entity without HitboxComponent. Source Entity: " + entity);
}
if (otherHitbox == null) {
logger.debug("Warning: Other Entity without HitboxComponent. Other Entity: " + otherEntity);
}

continue;
}

Expand Down

0 comments on commit d61f074

Please sign in to comment.