Search in sources :

Example 1 with FloatProcedure

use of org.eclipse.collections.api.block.procedure.primitive.FloatProcedure in project narchy by automenta.

the class SpaceKeys method accept.

@Override
public void accept(JoglWindow j) {
    RoaringBitmap queue = this.queue;
    if (!queue.isEmpty()) {
        float dt = j.dtMS() / 1000f;
        synchronized (on) {
            this.queue = new RoaringBitmap();
        }
        queue.forEach((int k) -> {
            // shouldnt ever be zero actually
            boolean s = k >= 0;
            FloatProcedure f = ((s) ? keyPressed : keyReleased).get(Math.abs(k));
            if (f != null)
                f.value(dt);
        });
    }
}
Also used : FloatProcedure(org.eclipse.collections.api.block.procedure.primitive.FloatProcedure) RoaringBitmap(org.roaringbitmap.RoaringBitmap)

Aggregations

FloatProcedure (org.eclipse.collections.api.block.procedure.primitive.FloatProcedure)1 RoaringBitmap (org.roaringbitmap.RoaringBitmap)1