Class NPCFactory

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

public class NPCFactory extends Object
Factory to create non-playable character (NPC) entities with predefined components.

Each NPC entity type should have a creation method that returns a corresponding entity. Predefined entity properties can be loaded from configs stored as json files which are defined in "NPCConfigs".

If needed, this factory can be separated into more specific factories for entities with similar characteristics.

  • Method Details

    • createGhost

      public static Entity createGhost()
      Creates a ghost entity.
      Returns:
      entity
    • createGhostKing

      public static Entity createGhostKing()
      Creates a ghost king entity.
      Returns:
      entity
    • createSkeleton

      public static Entity createSkeleton(int health)
      Creates a fire worm entity.
      Returns:
      entity
    • createWizard

      public static Entity createWizard(int health)
      Creates a wizard entity.
      Returns:
      entity
    • createWaterQueen

      public static Entity createWaterQueen(int health)
      Creates a water queen entity.
      Returns:
      entity
    • createBaseWaterSlime

      public static Entity createBaseWaterSlime(int health)
      Creates a water slime entity.
      Returns:
      entity
    • createFireWorm

      public static Entity createFireWorm(int health)
      Creates a fire worm entity.
      Returns:
      entity
    • createDragonKnight

      public static Entity createDragonKnight(int health)
      Creates a dragon Knight entity
      Returns:
      entity
    • createXenoGrunt

      public static Entity createXenoGrunt(int health)
      Creates a xeno grunt entity.
      Returns:
      entity
    • createMeleeBaseNPC

      public static Entity createMeleeBaseNPC()
      Creates a generic NPC to be used as a base entity by more specific NPC creation methods.
      Returns:
      entity
    • createRangedBaseNPC

      public static Entity createRangedBaseNPC()
      Creates a generic NPC to be used as a base entity by more specific NPC creation methods.
      Returns:
      entity
    • createSplittingXenoGrunt

      public static Entity createSplittingXenoGrunt(int health)
    • createSplittingWaterSlime

      public static Entity createSplittingWaterSlime(int health)
      Create Splitting water slime
      Returns:
    • createDodgingDragonKnight

      public static Entity createDodgingDragonKnight(int health)
      Create a dodging Dragon Knight
      Returns:
    • createDeflectWizard

      public static Entity createDeflectWizard(int health)
      Creates a wizard that can deflect bullets
      Returns: