Class TowerFactory

java.lang.Object
com.csse3200.game.entities.factories.TowerFactory

public class TowerFactory extends Object
Factory to create a tower entity. Predefined tower properties are loaded from a config stored as a json file and should have the properties stores in 'baseTowerConfigs'.
  • Constructor Details

    • TowerFactory

      public TowerFactory()
  • Method Details

    • createIncomeTower

      public static Entity createIncomeTower()
      Creates an income tower that generates scrap
      Returns:
      income
    • createWallTower

      public static Entity createWallTower()
    • createTNTTower

      public static Entity createTNTTower()
      Create a type of TNT that explodes once it detects a mob within a certain range. Upon detonation, the TNT will apply both knock-back and health damage to the affected mobs
      Returns:
      entity
    • createDroidTower

      public static Entity createDroidTower()
      This robotic unit is programmed to detect mobs within its vicinity and fire projectiles at them. The droid has the capability to switch its aim from high to low positions, thereby providing a versatile attack strategy. When it detects a mob, the droid releases a projectile that inflicts both physical damage and a slow-down effect on the target.
      Returns:
      entity
    • createWeaponTower

      public static Entity createWeaponTower()
      Creates a weaponry tower that shoots at mobs - This will most likely need to be extended once other types of weapon towers are developed
      Returns:
      entity
    • createFireTower

      public static Entity createFireTower()
      Creates the FireTower entity which shoots at mobs traversing in a straight line.
      Returns:
      FireTower entity with relevant components.
    • createStunTower

      public static Entity createStunTower()
      Creates the StunTower entity which shoots at mobs traversing in a straight line.
      Returns:
      StunTower entity with relevant components.
    • createFireworksTower

      public static Entity createFireworksTower()
      Creates the FireworksTower entity which shoots at mobs traversing in a straight line.
      Returns:
      FireworksTower entity with relevant components.
    • createPierceTower

      public static Entity createPierceTower()
      Creates the PierceTower entity which shoots at mobs traversing in a straight line.
      Returns:
      PierceTower entity with relevant components.
    • createRicochetTower

      public static Entity createRicochetTower()
      Creates the RicochetTower entity which shoots at mobs traversing in a straight line.
      Returns:
      RicochetTower entity with relevant components.
    • createHealTower

      public static Entity createHealTower()
    • createBaseTower

      public static Entity createBaseTower()
      Creates a generic tower entity to be used as a base entity by more specific tower creation methods.
      Returns:
      entity
    • createAndPlaceTower

      public static Entity createAndPlaceTower(int lane)
    • isLaneOccupied

      public static boolean isLaneOccupied(int lane)
      Checks if a lane is already occupied by a tower.
      Parameters:
      lane - The lane to check.
      Returns:
      True if the lane is occupied, false otherwise.