Class RobotFactory
java.lang.Object
com.csse3200.game.entities.factories.RobotFactory
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Loads enemy config data from JSON. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
createRobotType
(RobotFactory.RobotType robotType) A basic function to create a specific type of robot depending on the input.static Entity
createTeleportRobot
(BaseEnemyConfig cfg, float[] laneYs) Creates a Teleport Robot with teleport behaviour attached.
-
Constructor Details
-
RobotFactory
public RobotFactory()
-
-
Method Details
-
createRobotType
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
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
-