/** * Add new plugins. */ private void addPlugins(ArtemisPlugin[] plugins) { for (ArtemisPlugin plugin : plugins) { if (containsType(this.plugins, plugin.getClass())) { throw new WorldConfigurationException("Plugin of type " + plugin.getClass() + " registered twice. Only once allowed."); } this.plugins.add(ConfigurationElement.of(plugin)); } }
/** * helper to queue systems for registration. */ private void addSystems(int priority, BaseSystem[] systems) { for (BaseSystem system : systems) { if (containsType(this.systems, system.getClass())) { throw new WorldConfigurationException("System of type " + system.getClass() + " registered twice. Only once allowed."); } this.systems.add(new ConfigurationElement<BaseSystem>(system, priority)); } }
/** * helper to queue systems for registration. */ private void addSystems(int priority, BaseSystem[] systems) { for (BaseSystem system : systems) { if (containsType(this.systems, system.getClass())) { throw new WorldConfigurationException("System of type " + system.getClass() + " registered twice. Only once allowed."); } this.systems.add(new ConfigurationElement<BaseSystem>(system, priority)); } }
/** * Add new plugins. */ private void addPlugins(ArtemisPlugin[] plugins) { for (ArtemisPlugin plugin : plugins) { if (containsType(this.plugins, plugin.getClass())) { throw new WorldConfigurationException("Plugin of type " + plugin.getClass() + " registered twice. Only once allowed."); } this.plugins.add(ConfigurationElement.of(plugin)); } }
protected void dependsOnSystem(int priority, Class<? extends BaseSystem> type) throws ReflectionException { if (!containsType(systems, type)) { this.systems.add(ConfigurationElement.of(ClassReflection.newInstance(type), priority)); } }
protected void dependsOnSystem(int priority, Class<? extends BaseSystem> type) throws ReflectionException { if (!containsType(systems, type)) { this.systems.add(ConfigurationElement.of(ClassReflection.newInstance(type), priority)); } }
private void dependsOnPlugin(Class<? extends ArtemisPlugin> type) throws ReflectionException { if (ClassReflection.isAbstractClass(type)) { if (!anyAssignableTo(plugins, type)) { throw new WorldConfigurationException("Implementation of " + type + " expected but not found. Did you forget to include a plugin? (for example: logging-libgdx for logging-api)"); } } else { if (!containsType(plugins, type)) { this.plugins.add(ConfigurationElement.of(ClassReflection.newInstance(type))); } } }
private void dependsOnPlugin(Class<? extends ArtemisPlugin> type) throws ReflectionException { if (ClassReflection.isAbstractClass(type)) { if (!anyAssignableTo(plugins, type)) { throw new WorldConfigurationException("Implementation of " + type + " expected but not found. Did you forget to include a plugin? (for example: logging-libgdx for logging-api)"); } } else { if (!containsType(plugins, type)) { this.plugins.add(ConfigurationElement.of(ClassReflection.newInstance(type))); } } }