public final class WorldConfiguration extends Object
allows convenient creation.
Modifier and Type | Field and Description |
---|---|
static int |
ASPECT_SUBSCRIPTION_MANAGER_IDX |
static int |
COMPONENT_MANAGER_IDX |
static int |
ENTITY_MANAGER_IDX |
protected int |
expectedEntityCount |
protected Map<String,Object> |
injectables |
protected Injector |
injector |
protected SystemInvocationStrategy |
invocationStrategy |
Constructor and Description |
---|
WorldConfiguration() |
Modifier and Type | Method and Description |
---|---|
int |
expectedEntityCount() |
WorldConfiguration |
expectedEntityCount(int expectedEntityCount)
Initializes array type containers with the value supplied.
|
boolean |
isAlwaysDelayComponentRemoval()
Delay component removal until all subscriptions have been notified.
|
WorldConfiguration |
register(Object o)
Manually register object for injection by type.
|
WorldConfiguration |
register(String name,
Object o)
Manually register object for injection by name.
|
void |
setAlwaysDelayComponentRemoval(boolean value)
Delay component removal until all subscriptions have been notified.
|
WorldConfiguration |
setInjector(Injector injector)
Set Injector to handle all dependency injections.
|
WorldConfiguration |
setInvocationStrategy(SystemInvocationStrategy invocationStrategy)
Set strategy for invoking systems on
World.process() . |
WorldConfiguration |
setSystem(Class<? extends BaseSystem> system)
Adds a system to this world that will be processed by
World.process() . |
<T extends BaseSystem> |
setSystem(T system)
Will add a system to this world.
|
public static final int COMPONENT_MANAGER_IDX
public static final int ENTITY_MANAGER_IDX
public static final int ASPECT_SUBSCRIPTION_MANAGER_IDX
protected int expectedEntityCount
protected Injector injector
protected SystemInvocationStrategy invocationStrategy
public int expectedEntityCount()
public WorldConfiguration expectedEntityCount(int expectedEntityCount)
expectedEntityCount
- count of expected entities.public WorldConfiguration setInjector(Injector injector)
injector
- Injector to handle dependency injections.public WorldConfiguration setInvocationStrategy(SystemInvocationStrategy invocationStrategy)
World.process()
.invocationStrategy
- Strategy that will invoke systems.public WorldConfiguration register(Object o)
@Wire
. A class level
@Wire
annotation is not enough.
Since objects are injected by type, this method is limited to one object per type.
Use register(String, Object)
to register multiple objects of the same type.
Not required for systems.o
- object to inject.public WorldConfiguration register(String name, Object o)
@Wire(name="myName")
. A class
level @Wire
annotation is not enough.
Not required for systems.name
- unique identifier matching injection site name.o
- object to inject.public WorldConfiguration setSystem(Class<? extends BaseSystem> system)
World.process()
.system
- the system to addpublic <T extends BaseSystem> WorldConfiguration setSystem(T system)
T
- the system class typesystem
- the system to addpublic boolean isAlwaysDelayComponentRemoval()
listeners
have been notified - regardless
of removal method.public void setAlwaysDelayComponentRemoval(boolean value)
listeners
have been notified - regardless
of removal method.
Has a slight performance cost.value
- When true
, component removal for all components will be delayed.Copyright © 2019. All rights reserved.