package nz.ac.massey.javaecs.examples.Systems;

import java.util.BitSet;

import nz.ac.massey.javaecs.ECSSystem;
import nz.ac.massey.javaecs.Engine;
import nz.ac.massey.javaecs.Entity;
import nz.ac.massey.javaecs.examples.Components.ComflabulationComponent;

public class ComflabSystem extends ECSSystem  {
    Engine ecs;

    public ComflabSystem(Engine ecs){
        this.ecs = ecs;
        registrationSet = new BitSet();
        registrationSet.set(ecs.getComponentIndex(ComflabulationComponent.class));
    }

    @Override
    public void init() {
        // TODO Auto-generated method stub
        
    }

    @Override
    public void update(double dt) {
        for (Entity entity : entities) {
            ComflabulationComponent comflab = (ComflabulationComponent)ecs.getComponentData(entity, ComflabulationComponent.class);
            comflab.thingy *= 1.000001;
            comflab.mingy = !comflab.mingy;
            comflab.dingy++;
        } 
    }
}
