Class ScriptedSpawner.CreatureBuilder
java.lang.Object
de.gurkenlabs.litiengine.scripting.ScriptedSpawner.EntityBuilder<Creature>
de.gurkenlabs.litiengine.scripting.ScriptedSpawner.CreatureBuilder
- Enclosing class:
ScriptedSpawner
public static final class ScriptedSpawner.CreatureBuilder
extends ScriptedSpawner.EntityBuilder<Creature>
Type-preserving builder for creatures.
-
Field Summary
Fields inherited from class ScriptedSpawner.EntityBuilder
customizer, env, factory, health, location, name, renderType, tags -
Constructor Summary
ConstructorsConstructorDescriptionCreatureBuilder(Environment env, String spritePrefix) Creates a creature builder. -
Method Summary
Modifier and TypeMethodDescriptionat(double x, double y) Sets the spawn coordinates.Sets the spawn location.Sets an operation invoked after standard configuration but before insertion.withHealth(int health) Sets current and maximum hit points when the entity supports combat.Sets the entity name.Sets tags to add to the entity.Methods inherited from class ScriptedSpawner.EntityBuilder
spawn, withRenderType
-
Constructor Details
-
CreatureBuilder
Creates a creature builder.- Parameters:
env- The destination environment.spritePrefix- The animation sprite prefix.
-
-
Method Details
-
at
Description copied from class:ScriptedSpawner.EntityBuilderSets the spawn coordinates.- Overrides:
atin classScriptedSpawner.EntityBuilder<Creature>- Parameters:
x- The map x-coordinate.y- The map y-coordinate.- Returns:
- This builder.
-
at
Description copied from class:ScriptedSpawner.EntityBuilderSets the spawn location.- Overrides:
atin classScriptedSpawner.EntityBuilder<Creature>- Parameters:
location- The location in map coordinates;nullleaves it unchanged.- Returns:
- This builder.
-
withName
Description copied from class:ScriptedSpawner.EntityBuilderSets the entity name.- Overrides:
withNamein classScriptedSpawner.EntityBuilder<Creature>- Parameters:
name- The name to assign.- Returns:
- This builder.
-
withTags
Description copied from class:ScriptedSpawner.EntityBuilderSets tags to add to the entity.- Overrides:
withTagsin classScriptedSpawner.EntityBuilder<Creature>- Parameters:
tags- The tags; null entries are ignored.- Returns:
- This builder.
-
withHealth
Description copied from class:ScriptedSpawner.EntityBuilderSets current and maximum hit points when the entity supports combat.- Overrides:
withHealthin classScriptedSpawner.EntityBuilder<Creature>- Parameters:
health- The hit-point value.- Returns:
- This builder.
-
configure
Description copied from class:ScriptedSpawner.EntityBuilderSets an operation invoked after standard configuration but before insertion.- Overrides:
configurein classScriptedSpawner.EntityBuilder<Creature>- Parameters:
customizer- The customizer, ornullfor none.- Returns:
- This builder.
-