Class StructureFactory

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

public class StructureFactory extends Object
Factory to create structure entities - such as extractors or ships.

Each obstacle entity type should have a creation method that returns a corresponding entity.

  • Field Details

    • defaultShip

      public static final ShipConfig defaultShip
  • Method Details

    • createExtractor

      public static PlaceableEntity createExtractor(ExtractorConfig config)
      Creates an extractor entity

      Each obstacle entity type should have a creation method that returns a corresponding entity.

      Parameters:
      config - Configuration file to match extractor to
      Returns:
      a new extractor Entity
    • createExtractorRepair

      public static Entity createExtractorRepair()
    • createExtinguisher

      public static Entity createExtinguisher(TerrainComponent terrain, ExtractorMiniGameArea area)
    • createSpanner

      public static Entity createSpanner(TerrainComponent terrain, ExtractorMiniGameArea area)
    • createExtractorFirePart

      public static Entity createExtractorFirePart(TerrainComponent terrain, ExtractorMiniGameArea area)
    • createExtractorHolePart

      public static Entity createExtractorHolePart(TerrainComponent terrain, ExtractorMiniGameArea area)
    • createExtractorBang

      public static Entity createExtractorBang()
    • createExtractor

      public static PlaceableEntity createExtractor(int health, Resource producedResource, long tickRate, int tickSize)
      Creates an extractor entity

      Each obstacle entity type should have a creation method that returns a corresponding entity.

      Parameters:
      health - the max and initial health of the extractor
      producedResource - the resource type produced by the extractor
      tickRate - the frequency at which the extractor ticks (produces resources)
      tickSize - the amount of the resource produced at each tick
      Returns:
      a new extractor Entity
    • createExtractorRepairPart

      public static Entity createExtractorRepairPart()
    • createShip

      public static Entity createShip(GdxGame game, List<ResourceCondition> requirements)
      Creates a ship entity that uses the default package
    • createShip

      public static Entity createShip(GdxGame game, List<ResourceCondition> requirements, ShipConfig config)
      Creates a ship entity that matches the config file
    • createSpawner

      public static Entity createSpawner(SpawnerConfig config)
      Create an enemy spawner that spawns the desired enemies at a given tick rate and at a given location on the map
      Parameters:
      config - the config file to read and select the waves for the spawner to activate
      Returns: