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 EntityCreates a generic NPC to be used as a base entity by more specific NPC creation methods.static EntitycreateElectricEelEnemy(Entity target, Entity crystal) static EntitycreateMeleeBoss(Entity target) Creates a melee boss entitystatic EntityCreates a new normal NPC.static EntitycreatePirateCrabEnemy(Entity target) Creates a pirate Crab entitystatic EntityCreates a new special NPC.static EntitycreateStarFishEnemy(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
-