Class TowerFactory
java.lang.Object
com.csse3200.game.entities.factories.TowerFactory
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createAndPlaceTower
(int lane) static Entity
Creates a generic tower entity to be used as a base entity by more specific tower creation methods.static Entity
This robotic unit is programmed to detect mobs within its vicinity and fire projectiles at them.static Entity
Creates the FireTower entity which shoots at mobs traversing in a straight line.static Entity
Creates the FireworksTower entity which shoots at mobs traversing in a straight line.static Entity
static Entity
Creates an income tower that generates scrapstatic Entity
Creates the PierceTower entity which shoots at mobs traversing in a straight line.static Entity
Creates the RicochetTower entity which shoots at mobs traversing in a straight line.static Entity
Creates the StunTower entity which shoots at mobs traversing in a straight line.static Entity
Create a type of TNT that explodes once it detects a mob within a certain range.static Entity
static Entity
Creates a weaponry tower that shoots at mobs - This will most likely need to be extended once other types of weapon towers are developedstatic boolean
isLaneOccupied
(int lane) Checks if a lane is already occupied by a tower.
-
Constructor Details
-
TowerFactory
public TowerFactory()
-
-
Method Details
-
createIncomeTower
Creates an income tower that generates scrap- Returns:
- income
-
createWallTower
-
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
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
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
Creates the FireTower entity which shoots at mobs traversing in a straight line.- Returns:
- FireTower entity with relevant components.
-
createStunTower
Creates the StunTower entity which shoots at mobs traversing in a straight line.- Returns:
- StunTower entity with relevant components.
-
createFireworksTower
Creates the FireworksTower entity which shoots at mobs traversing in a straight line.- Returns:
- FireworksTower entity with relevant components.
-
createPierceTower
Creates the PierceTower entity which shoots at mobs traversing in a straight line.- Returns:
- PierceTower entity with relevant components.
-
createRicochetTower
Creates the RicochetTower entity which shoots at mobs traversing in a straight line.- Returns:
- RicochetTower entity with relevant components.
-
createHealTower
-
createBaseTower
Creates a generic tower entity to be used as a base entity by more specific tower creation methods.- Returns:
- entity
-
createAndPlaceTower
-
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.
-