Class RobotFactory

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

public class RobotFactory 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

    • RobotFactory

      public RobotFactory()
  • Method Details

    • createRobotType

      public static Entity createRobotType(RobotFactory.RobotType robotType)
      A basic function to create a specific type of robot depending on the input. make this use constants of some kind. Or EntityConfig classes If an invalid type is given, a standard robot is created
      Parameters:
      robotType - The type of robot to create
      Returns:
      The created robot
    • createTeleportRobot

      public static Entity createTeleportRobot(BaseEnemyConfig cfg, float[] laneYs)
      Creates a Teleport Robot with teleport behaviour attached.
      Parameters:
      cfg - Teleport robot config (stats and teleport params)
      laneYs - Candidate lane Y positions to teleport between (must contain at least 2)
      Returns:
      Entity with base robot components plus TeleportTask