Class PlantFactory

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

public class PlantFactory extends Object
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 Details

    • PlantFactory

      public PlantFactory()
  • Method Details

    • setStats

      public static void setStats(PlantConfigs newStats)
      Sets the plant statistics.
      Parameters:
      newStats - The new statistics to be set for the plant.
    • createBasePlant

      public static Entity createBasePlant(BasePlantConfig config, CropTileComponent cropTile)
      Creates a generic plant to be used as a base for more specific plant creation methods.
      Returns:
      entity
    • createCosmicCob

      public static Entity createCosmicCob(CropTileComponent cropTile)
      Creates a cosmicCob entity that is a Food type plant.
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      entity
    • createAloeVera

      public static Entity createAloeVera(CropTileComponent cropTile)
      Creates an AloeVera entity that is a health type plant.
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      entity
    • createHammerPlant

      public static Entity createHammerPlant(CropTileComponent cropTile)
      Creates a HammerPlant entity that is a repair type plant.
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      entity
    • createSpaceSnapper

      public static Entity createSpaceSnapper(CropTileComponent cropTile)
      Creates an venusFlyTrap entity that is a defence type plant.
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      entity
    • createAtomicAlgae

      public static Entity createAtomicAlgae(CropTileComponent cropTile)
      Creates a waterWeed entity that is a production type plant.
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      entity
    • createDeadlyNightshade

      public static Entity createDeadlyNightshade(CropTileComponent cropTile)
      Creates a Nightshade entity that is a deadly type plant.
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      entity
    • createTest

      public static Entity createTest(CropTileComponent cropTile)
      Create a plant for testing
      Parameters:
      cropTile - Crop tile upon which the plant is planted
      Returns:
      new plant entity