Class NPCFactory

java.lang.Object
com.deco2800.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

    • createKnight

      public static Entity createKnight(Entity target)
    • createRobot

      public static Entity createRobot(Entity target)
    • createSlime

      public static Entity createSlime(Entity target)
    • createBobo

      public static Entity createBobo(Entity target)
    • createPiranha

      public static Entity createPiranha(Entity target)
    • createGhost

      public static Entity createGhost(Entity target)
      Creates a ghost entity.
      Parameters:
      target - entity to chase
      Returns:
      entity
    • createGhostKing

      public static Entity createGhostKing(Entity target)
      Creates a ghost king entity.
      Parameters:
      target - entity to chase
      Returns:
      entity
    • createZoe

      public static Entity createZoe(NpcInteractionDisplay npcInteractionDisplay)
    • createMetis

      public static Entity createMetis(NpcInteractionDisplay npcInteractionDisplay)
    • createDoris

      public static Entity createDoris(NpcInteractionDisplay npcInteractionDisplay)
    • createHeph

      public static Entity createHeph(NpcInteractionDisplay npcInteractionDisplay)
    • createOrpheus

      public static Entity createOrpheus(NpcInteractionDisplay npcInteractionDisplay)
    • createNereus

      public static Entity createNereus()
    • createNeutralLives

      public static Entity createNeutralLives(Entity target)