当前位置: 首页>>代码示例>>Java>>正文


Java BaseSystem类代码示例

本文整理汇总了Java中com.artemis.BaseSystem的典型用法代码示例。如果您正苦于以下问题:Java BaseSystem类的具体用法?Java BaseSystem怎么用?Java BaseSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BaseSystem类属于com.artemis包,在下文中一共展示了BaseSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enter

import com.artemis.BaseSystem; //导入依赖的package包/类
@Override
public void enter(NhgEntry nhgEntry) {
    NhgLogger.log(this, "Engine is closing.");
    nhgEntry.onClose();

    ImmutableBag<BaseSystem> systems = nhgEntry.nhg.entities.getEntitySystems();
    for (BaseSystem bs : systems) {
        if (bs instanceof Disposable) {
            ((Disposable) bs).dispose();
        }
    }

    nhgEntry.nhg.assets.dispose();
    nhgEntry.nhg.threading.terminate();
    Gdx.app.exit();
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:17,代码来源:EngineStateClosing.java

示例2: injectField

import com.artemis.BaseSystem; //导入依赖的package包/类
@Override
protected boolean injectField (Object target, Field field, Class<?> type) throws ReflectiveOperationException {
	boolean alreadyInjected = super.injectField(target, field, type);
	if (alreadyInjected) return true;

	//artemis already handles injecting objects inside systems
	if (target instanceof BaseSystem) return false;

	if (BaseSystem.class.isAssignableFrom(type)) {
		field.setAccessible(true);
		field.set(target, engine != null ? engine.getSystem(type.asSubclass(BaseSystem.class)) : config.getSystem(type.asSubclass(BaseSystem.class)));
		return true;
	}

	if (ComponentMapper.class.isAssignableFrom(type)) {
		field.setAccessible(true);
		if (engine == null)
			delayedCompMapperToInject.add(new BiHolder<>(target, field));
		else
			injectComponentMapper(target, field);

		return true;
	}

	return false;
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:27,代码来源:SceneModuleContainer.java

示例3: hasSystemClass

import com.artemis.BaseSystem; //导入依赖的package包/类
private boolean hasSystemClass(Class<? extends BaseSystem> systemClass, Array<BaseSystem> entitySystems) {
    boolean res = false;

    for (BaseSystem es : entitySystems) {
        if (systemClass.isInstance(es)) {
            res = true;
        }
    }

    return res;
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:12,代码来源:EngineStateNotInitialized.java

示例4: onConfigureEntitySystems

import com.artemis.BaseSystem; //导入依赖的package包/类
@Override
public Array<BaseSystem> onConfigureEntitySystems() {
    Array<BaseSystem> systems = new Array<>();
    systems.add(new TestNodeSystem());

    return systems;
}
 
开发者ID:MovementSpeed,项目名称:nhglib,代码行数:8,代码来源:Main.java

示例5: registerAllSystemEvents

import com.artemis.BaseSystem; //导入依赖的package包/类
/** Register all systems in this world. */
private void registerAllSystemEvents( )
{
    for (BaseSystem entitySystem : world.getSystems()) {
        registerEvents(entitySystem);
    }
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:8,代码来源:EventSystem.java

示例6: Registration_AllTypesWithNoListeners_NoExceptions

import com.artemis.BaseSystem; //导入依赖的package包/类
@Test
public void Registration_AllTypesWithNoListeners_NoExceptions() {
    config.setSystem(new BaseSystem() {
        @Override
        protected void processSystem() {
        }
    });
    config.setSystem(new Manager() {
    });
    final World w = new World(config);
    w.getSystem(EventSystem.class).registerEvents(new Object() {});
    w.getSystem(EventSystem.class).dispatch(new SimpleEvent());
    // no exception? happy!
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:15,代码来源:EventSystemTest.java

示例7: getFor

import com.artemis.BaseSystem; //导入依赖的package包/类
/**
 * Get profiler for given system
 * @return profiler or null
 */
public static SystemProfiler getFor (BaseSystem system) {
	Object[] items = profilers.items;
	for (int i = 0; i < profilers.size; i++) {
		SystemProfiler profiler = (SystemProfiler)items[i];
		if (profiler.system == system) {
			return profiler;
		}
	}
	return null;
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:15,代码来源:SystemProfiler.java

示例8: initialize

import com.artemis.BaseSystem; //导入依赖的package包/类
@Override
public void initialize(BaseSystem baseSystem, World world) {
	system = baseSystem;
	if (name == null) {
		name = toString();
	}
	if (color == null) {
		calculateColor(toString().hashCode(), color = new Color());
	}
	SystemProfiler.add(this);
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:12,代码来源:SystemProfiler.java

示例9: processProfileSystems

import com.artemis.BaseSystem; //导入依赖的package包/类
private void processProfileSystems(Bag<BaseSystem> systems) {
    final Object[] systemsData = systems.getData();
    for (int i = 0, s = systems.size(); s > i; i++) {
        if (disabled.get(i))
            continue;

        updateEntityStates();
        processProfileSystem(profilers[i], (BaseSystem) systemsData[i]);
    }

    updateEntityStates();
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:13,代码来源:ProfilerInvocationStrategy.java

示例10: createSystemProfilers

import com.artemis.BaseSystem; //导入依赖的package包/类
private void createSystemProfilers() {
    final ImmutableBag<BaseSystem> systems = world.getSystems();
    profilers = new SystemProfiler[systems.size()];
    for (int i = 0; i < systems.size(); i++) {
        profilers[i] = createSystemProfiler(systems.get(i));
    }
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:8,代码来源:ProfilerInvocationStrategy.java

示例11: createSystemProfiler

import com.artemis.BaseSystem; //导入依赖的package包/类
private SystemProfiler createSystemProfiler(BaseSystem system) {
    SystemProfiler old = SystemProfiler.getFor(system);
    if (old == null) {
        old = SystemProfiler.createFor(system, world);
    }
    return old;
}
 
开发者ID:DaanVanYperen,项目名称:artemis-odb-contrib,代码行数:8,代码来源:ProfilerInvocationStrategy.java

示例12: init

import com.artemis.BaseSystem; //导入依赖的package包/类
/**
 * Finishes loading scene and inflate all entities. This must be called manually if scene wasn't loaded
 * using {@link VisAssetManager} loadSceneNow methods.
 */
public void init () {
	engine.setInvocationStrategy(new BootstrapInvocationStrategy());
	engine.process();
	engine.setInvocationStrategy(new InvocationStrategy());

	for (BaseSystem system : engine.getSystems()) {
		if (system instanceof AfterSceneInit) {
			((AfterSceneInit) system).afterSceneInit();
		}
	}
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:16,代码来源:Scene.java

示例13: create

import com.artemis.BaseSystem; //导入依赖的package包/类
@Override
public BaseSystem create (EntityEngineConfiguration config, RuntimeContext context, SceneData data) {
	try {
		return ClassReflection.newInstance(systemClass);
	} catch (ReflectionException e) {
		throw new IllegalStateException("Failed to create system using reflection", e);
	}
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:9,代码来源:ReflectionSystemProvider.java

示例14: getSystem

import com.artemis.BaseSystem; //导入依赖的package包/类
public <C extends BaseSystem> C getSystem (Class<C> clazz) {
	if (built)
		throw new IllegalStateException("This configuration was already build and it's contents cannot be accessed!");

	for (int i = 0; i < systems.size; i++) {
		BaseSystem system = systems.get(i);
		if (system.getClass() == clazz) return clazz.cast(system);
	}

	throw new IllegalStateException("Failed to get system: '" + clazz + "', system not added!");
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:12,代码来源:EntityEngineConfiguration.java

示例15: build

import com.artemis.BaseSystem; //导入依赖的package包/类
public WorldConfiguration build () {
	if (built) throw new IllegalStateException("Cannot built configuration twice!");
	built = true;
	WorldConfiguration config = new WorldConfiguration();

	for (BaseSystem system : systems) {
		config.setSystem(system);
	}

	return config;
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:12,代码来源:EntityEngineConfiguration.java


注:本文中的com.artemis.BaseSystem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。