Class NPCFactory
java.lang.Object
com.deco2800.game.entities.factories.NPCFactory
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 Summary
Modifier and TypeMethodDescriptionstatic Entity
Creates a generic NPC to be used as a base entity by more specific NPC creation methods.static Entity
createElectricEelEnemy
(Entity target, Entity crystal) static Entity
createMeleeBoss
(Entity target) Creates a melee boss entitystatic Entity
Creates a new normal NPC.static Entity
createPirateCrabEnemy
(Entity target) Creates a pirate Crab entitystatic Entity
Creates a new special NPC.static Entity
createStarFishEnemy
(Entity target, Entity crystal)
-
Method Details
-
createPirateCrabEnemy
Creates a pirate Crab entity- Parameters:
target
- entity to chase- Returns:
- Entity
-
createElectricEelEnemy
-
createMeleeBoss
Creates a melee boss entity- Parameters:
target
- entity to chase- Returns:
- Entity
-
createStarFishEnemy
-
createBaseNPC
Creates a generic NPC to be used as a base entity by more specific NPC creation methods.- Returns:
- entity
-
createSpecialNPC
Creates a new special NPC.- Returns:
- special NPC.
-
createNormalNPC
Creates a new normal NPC.- Returns:
- normal NPC
-