Class PlantFactory
java.lang.Object
com.csse3200.game.entities.factories.PlantFactory
Factory to create plant entities.
Predefined plant properties are loaded from a config file stored as a json file and should have the properties stored in the PlantConfig classes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createAloeVera
(CropTileComponent cropTile) Creates an AloeVera entity that is a health type plant.static Entity
createAtomicAlgae
(CropTileComponent cropTile) Creates a waterWeed entity that is a production type plant.static Entity
createBasePlant
(BasePlantConfig config, CropTileComponent cropTile) Creates a generic plant to be used as a base for more specific plant creation methods.static Entity
createCosmicCob
(CropTileComponent cropTile) Creates a cosmicCob entity that is a Food type plant.static Entity
createDeadlyNightshade
(CropTileComponent cropTile) Creates a Nightshade entity that is a deadly type plant.static Entity
createHammerPlant
(CropTileComponent cropTile) Creates a HammerPlant entity that is a repair type plant.static Entity
createSpaceSnapper
(CropTileComponent cropTile) Creates an venusFlyTrap entity that is a defence type plant.static Entity
createTest
(CropTileComponent cropTile) Create a plant for testingstatic void
setStats
(PlantConfigs newStats) Sets the plant statistics.
-
Constructor Details
-
PlantFactory
public PlantFactory()
-
-
Method Details
-
setStats
Sets the plant statistics.- Parameters:
newStats
- The new statistics to be set for the plant.
-
createBasePlant
Creates a generic plant to be used as a base for more specific plant creation methods.- Returns:
- entity
-
createCosmicCob
Creates a cosmicCob entity that is a Food type plant.- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- entity
-
createAloeVera
Creates an AloeVera entity that is a health type plant.- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- entity
-
createHammerPlant
Creates a HammerPlant entity that is a repair type plant.- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- entity
-
createSpaceSnapper
Creates an venusFlyTrap entity that is a defence type plant.- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- entity
-
createAtomicAlgae
Creates a waterWeed entity that is a production type plant.- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- entity
-
createDeadlyNightshade
Creates a Nightshade entity that is a deadly type plant.- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- entity
-
createTest
Create a plant for testing- Parameters:
cropTile
- Crop tile upon which the plant is planted- Returns:
- new plant entity
-