public abstract class BaseSystem extends Object
initialize()
- Initialize your system, on top of the dependency injection.
begin()
- Called before the entities are processed.
processSystem()
- Called once per cycle.
end()
- Called after the entities have been processed.Wire
Modifier and Type | Field and Description |
---|---|
protected World |
world
The world this system belongs to.
|
Constructor and Description |
---|
BaseSystem() |
Modifier and Type | Method and Description |
---|---|
protected void |
begin()
Called before system processing begins.
|
protected boolean |
checkProcessing()
Does the system desire processing.
|
protected void |
dispose()
see
World.dispose() |
protected void |
end()
Called after the systems has finished processing.
|
protected World |
getWorld()
Get the world associated with the manager.
|
protected void |
initialize()
Override to implement code that gets executed when systems are
initialized.
|
boolean |
isEnabled()
Check if the system is enabled.
|
void |
process()
Process system.
|
protected abstract void |
processSystem()
Process the system.
|
void |
setEnabled(boolean enabled)
Enabled systems run during
process() . |
protected void |
setWorld(World world)
Set the world this system works on.
|
protected void begin()
Nota Bene: Any entities created in this method won't become active until the next system starts processing or when a new processing rounds begins, whichever comes first.
public final void process()
checkProcessing()
is false or the system
is disabled.InvocationStrategy
protected abstract void processSystem()
protected void end()
protected boolean checkProcessing()
both must be true before the system will process.
protected void initialize()
public boolean isEnabled()
true
if enabled, otherwise falsepublic void setEnabled(boolean enabled)
process()
.
This only affects processing, and does not affect events
or subscription lists.
Systems are enabled by default.enabled
- system will not run when set to falseboth must be true before the system will process.
protected void setWorld(World world)
world
- the world to setprotected World getWorld()
protected void dispose()
World.dispose()
Copyright © 2019. All rights reserved.