public class ArchetypeBuilder extends Object
edit()
on the Entity returned by World.createEntity(Archetype)
nullifies this optimization.
Generated archetypes provide a blueprint for quick entity creation.
Instance generated entities using World.createEntity(Archetype)
Constructor and Description |
---|
ArchetypeBuilder()
Constructs an empty archetype builder.
|
ArchetypeBuilder(Archetype parent)
Constructs an archetype builder containing the composition of the specified parent.
|
Modifier and Type | Method and Description |
---|---|
ArchetypeBuilder |
add(Class<? extends Component>... types)
Ensure this builder includes the specified component types.
|
ArchetypeBuilder |
add(Class<? extends Component> type)
Ensure this builder includes the specified component type.
|
Archetype |
build(World world)
Create a new world specific instance of Archetype based on the current state.
|
ArchetypeBuilder |
remove(Class<? extends Component>... types)
Remove the specified component from this builder, if it is present (optional operation).
|
ArchetypeBuilder |
remove(Class<? extends Component> type)
Remove the specified component from this builder, if it is present (optional operation).
|
public ArchetypeBuilder(Archetype parent)
parent
- archetype composition to copy.public ArchetypeBuilder()
public ArchetypeBuilder add(Class<? extends Component> type)
type
- public ArchetypeBuilder add(Class<? extends Component>... types)
types
- public ArchetypeBuilder remove(Class<? extends Component> type)
type
- public ArchetypeBuilder remove(Class<? extends Component>... types)
types
- Copyright © 2019. All rights reserved.