-
Notifications
You must be signed in to change notification settings - Fork 20
Plugin
Daan van Yperen edited this page Aug 2, 2015
·
17 revisions
- Wraps up your extension into an easy to use drop in plugin.
- Avoid conflicting managers/systems with other extensions.
- Inject systems/managers before/after others.
public class MyPlugin implements ArtemisPlugin {
@Override
public void setup(WorldConfigurationBuilder b) {
// hook plugins.
b.dependsOn(ExtendedComponentMapperPlugin.class);
// hook managers or systems.
b.dependsOn(TagManager.class, GroupManager.class);
b.dependsOn(MySystemA.class, MySystemB.class);
// Optionally Specify loading order.
b.with(WorldConfigurationBuilder.Priority.HIGH, new LoadFirstSystem());
// And your custom DI features!
b.register(new MyFieldResolver());
}
}
WorldConfiguration myConfig = new WorldConfigurationBuilder()
.with(new TagManager())
.with(new MyGameSystemA(), new MyGameSystemB())
.with(new MyPlugin())
.build();