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.

  • Constructor Details

    • NPCFactory

      public NPCFactory()
  • Method Details

    • createOneLegGirl

      public static Entity createOneLegGirl(Entity target)
      Creates an atlantis female NPC entity.
      Parameters:
      target - entity to stand
      Returns:
      entity
    • createChild

      public static Entity createChild(Entity target)
      Creates an atlantis child NPC entity.
      Parameters:
      target - entity to stand
      Returns:
      entity
    • createGuard

      public static Entity createGuard(Entity target)
      Creates an atlantis guard NPC entity.
      Parameters:
      target - entity to stand
      Returns:
      entity
    • createHumanGuard

      public static Entity createHumanGuard(Entity target)
    • createPlumberFriend

      public static Entity createPlumberFriend(Entity target)
    • createFriendlyCreature

      public static Entity createFriendlyCreature(Entity target)
      Creates a friendly creature NPC entity.
      Parameters:
      target - entity to stand
      Returns:
      entity
    • createmaleCitizen

      public static Entity createmaleCitizen(Entity target)
      Creates an atlantis male NPC entity.
      Parameters:
      target - entity to stand
      Returns:
      entity
    • createGymBro

      public static Entity createGymBro(Entity target)
      Creates an atlantis citizen entity.
      Parameters:
      target - entity to chase
      Returns:
      entity
    • createHeracles

      public static Entity createHeracles(Entity target)
      Creates Heracles, the boss of the first level.
      Returns:
      entity
    • createPoops

      public static Entity createPoops(Entity target)
      Creates Heracles, the boss of the first level.
      Returns:
      entity
    • createMegaPoop

      public static Entity createMegaPoop(Entity target)
      Creates Mega Poop, the boss of the second level.
      Returns:
      entity
    • createBaseNPC

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

      public static Entity createPlug(Entity target)
    • creatTestNPC

      public static Entity creatTestNPC(String NPCName)