Factory(World world, BitVector additions, BitVector removals) { this.cm = world.getComponentManager(); this.additions = additions; this.removals = removals; this.bs = new BitVector(); }
/** * @return entity subscription backing this system. */ public EntitySubscription getSubscription() { final AspectSubscriptionManager sm = world.getAspectSubscriptionManager(); return sm.get(aspectConfiguration); }
@Override public void initialize() { singletonEntity = world.createEntity(); world.addEntity(singletonEntity); }
EntityTransmuter(World world, BitVector additions, BitVector removals) { em = world.getEntityManager(); entityToIdentity = world.getComponentManager().entityToIdentity; batchProcessor = world.batchProcessor; operations = new Bag<TransmuteOperation>(TransmuteOperation.class); factory = new Factory(world, additions, removals); }
@Override public void write(int value, Component c, Field f) { Entity e = (value != -1) ? world.getEntity(value) : null; ((UniEntityLink) c).field = e; }
/** * Overridable method to provide custom time delta. */ protected float getTimeDelta() { return world.getDelta(); }
public KryoIntBagEntitySerializer (World world) { this.world = world; world.inject(this); }
protected BasePrefab(World world, PrefabReader<DATA> data) { this.world = world; this.data = data; serializationManager = world.getSystem(WorldSerializationManager.class); if (serializationManager == null) throw new MundaneWireException(WorldSerializationManager.class); world.inject(this); // TODO: #439 - generate .class from .json data.initialize(getPrefabDataPath()); }
/** * Delete the entity from the world. The entity is considered to be * in a final state once invoked; adding or removing components from an * entity scheduled for deletion will likely throw exceptions. */ public void deleteFromWorld() { world.delete(id); }
@Override public void initialize(World world) { this.world = world; for (BaseSystem es : world.getSystems()) { Class<?> origin = es.getClass(); Class<?> clazz = origin; do { systems.put(clazz, origin); } while ((clazz = clazz.getSuperclass()) != Object.class); } }
/** Begin building new entity based on archetype.*/ public EntityBuilder(World world, Archetype archetype) { this.world = world; edit = world.createEntity(archetype).edit(); }
BatchChangeProcessor(World world) { this.world = world; asm = world.getAspectSubscriptionManager(); EntityManager em = world.getEntityManager(); em.registerEntityStore(changed); em.registerEntityStore(deleted); em.registerEntityStore(pendingPurge); }
/** Fetch manager or throw RuntimeException if not registered. */ protected <T extends BaseSystem> T resolveManager(Class<T> type) { final T teamManager = world.getSystem(type); if ( teamManager == null ) { throw new RuntimeException("Register " + ClassReflection.getSimpleName(type) + " with your artemis world."); } return teamManager; } }
for (BaseSystem system : world.getSystems()) { system.setEnabled(true); for (BaseSystem system : world.getSystems()) { if (!(system instanceof RenderSystem)) { system.setEnabled(false); world.setDelta(delta); world.process();
/** * Get target entity of entity edits. * * @return Entity this EntityEdit operates on. */ public Entity getEntity() { return cm.world.getEntity(entityId); }
/** * Overridable method to provide custom time delta. */ protected float getTimeDelta() { return world.getDelta(); }
public IntBagEntitySerializer(World world) { this.world = world; world.inject(this); }
protected BasePrefab(World world, PrefabReader<DATA> data) { this.world = world; this.data = data; serializationManager = world.getSystem(WorldSerializationManager.class); if (serializationManager == null) throw new MundaneWireException(WorldSerializationManager.class); world.inject(this); // TODO: #439 - generate .class from .json data.initialize(getPrefabDataPath()); }