Class ScriptedSpawner
public final class ScriptedSpawner
Fluent builder for spawning typed entities directly into an environment from scripts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classType-preserving builder for creatures.static classScriptedSpawner.EntityBuilder<T extends IEntity>Configures an entity before adding it to an environment.static final classType-preserving builder for props. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStarts building aCreatureto spawn.<T extends IEntity>
ScriptedSpawner.EntityBuilder<T> Starts building an entity of arbitrary type via reflection.<T extends IEntity>
ScriptedSpawner.EntityBuilder<T> Starts building an entity supplied by a factory.<T extends IEntity>
ScriptedSpawner.EntityBuilder<T> entity(T entity) Starts configuring an existing entity instance to spawn.Starts building aPropto spawn.
-
Constructor Details
-
ScriptedSpawner
-
-
Method Details
-
creature
Starts building aCreatureto spawn.- Parameters:
spritePrefix- The animation sprite prefix.- Returns:
- A creature builder.
-
prop
Starts building aPropto spawn.- Parameters:
spriteSheet- The spritesheet name.- Returns:
- A prop builder.
-
entity
Starts building an entity of arbitrary type via reflection.- Type Parameters:
T- The entity type.- Parameters:
type- The concrete type, which must declare a no-argument constructor that reflection is permitted to open.- Returns:
- A builder using reflective construction.
-
entity
Starts building an entity supplied by a factory.- Type Parameters:
T- The entity type.- Parameters:
factory- The factory invoked for eachScriptedSpawner.EntityBuilder.spawn()call.- Returns:
- A builder using the factory.
-
entity
Starts configuring an existing entity instance to spawn.- Type Parameters:
T- The entity type.- Parameters:
entity- The entity to configure and add.- Returns:
- A builder that returns the supplied instance.
-