All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.artemis.systems.EntityProcessingSystem Maven / Gradle / Ivy

package com.artemis.systems;

import com.artemis.Entity;
import com.artemis.Filter;
import com.badlogic.gdx.utils.Array;

/**
 * A typical entity system. Use this when you need to process entities possessing the
 * provided component types.
 * 
 * @author Arni Arent
 *
 */
public abstract class EntityProcessingSystem extends EntitySystem {

    public EntityProcessingSystem(Filter filter) {
        super(filter);
    }

    /**
     * Process a entity this system is interested in.
     * @param e the entity to process.
     */
    protected abstract void process(Entity e);

    @Override
    protected final void processEntities(Array entities) {
        for (int i = 0, s = entities.size; s > i; i++) {
            process(entities.get(i));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy