Contents
Interface ISpawnable
- All Known Subinterfaces:
ISpawnableWithModel
- All Known Implementing Classes:
BuilderBaseWithType, BuilderMotionControllerBase, BuilderMotionControllerDive, BuilderMotionControllerFly, BuilderMotionControllerMap, BuilderMotionControllerWalk, BuilderRole, BuilderRoleAbstract, BuilderRoleVariant
public interface ISpawnable
Represents a class type that can be tested and processed for spawning
Created on 27/08/2019
-
Method Summary
Modifier and TypeMethodDescriptioncanSpawn(SpawningContext context) Called to test whether this spawnable class type is spawnable regarding the given contextvoidgetMovementModes(SpawningContext context, Set<MovementMode> outSupportedMovementModes, Set<MovementMode> outDefaultMovementModes, Set<MovementMode> outSafeMovementModes) Query all movement mode sets for this spawnable.default SpawnPositionPlacementgetSpawnPlacement(SpawningContext context) Query where a spawn position for this spawnable must sit for the movement mode in the context.booleanCalled to test whether a spawn drop height check applies to this spawnable for the given context.
-
Method Details
-
getIdentifier
- Returns:
- the unique identifier of the spawnable class type
-
canSpawn
Called to test whether this spawnable class type is spawnable regarding the given context- Parameters:
context- TheSpawningContextto test against- Returns:
trueif this spawnable can spawn,falseif otherwise
-
requiresSpawnDropHeightCheck
Called to test whether a spawn drop height check applies to this spawnable for the given context.The motion controller that supports the movement mode in the context resolves the answer. An implementation that cannot resolve it returns
true, so the caller keeps the check.- Parameters:
context- TheSpawningContextto test against- Returns:
trueif the caller must check the spawn drop height,falseif otherwise
-
getSpawnPlacement
Query where a spawn position for this spawnable must sit for the movement mode in the context.The motion controller that supports the movement mode in the context resolves the answer. An implementation that cannot resolve it returns
SpawnPositionPlacement.ON_GROUND.A position search uses the answer to place its candidates. The spawnable still judges the finished candidate in
canSpawn(SpawningContext).- Parameters:
context- TheSpawningContextto test against- Returns:
- the placement a spawn position must have
-
getMovementModes
void getMovementModes(@Nonnull SpawningContext context, @Nonnull Set<MovementMode> outSupportedMovementModes, @Nonnull Set<MovementMode> outDefaultMovementModes, @Nonnull Set<MovementMode> outSafeMovementModes) Query all movement mode sets for this spawnable.- Parameters:
context- TheSpawningContextto test againstoutSupportedMovementModes- Populated with every movement mode the NPC's motion controller is capable of. Must be cleared before population.outDefaultMovementModes- Populated with the movement modes used when no user configuration is present. Must be cleared before population.outSafeMovementModes- Populated with movement modes the NPC can use safely given its breathing configuration (e.g. air-breathing walkers exclude UNDERWATER_WALK). Must be cleared before population.
-