Java 类com.badlogic.gdx.utils.ReflectionPool 实例源码

项目:gdx.automation    文件:InputVisualizer.java   
public InputVisualizer() {
    eventBuffer = new RingBuffer<MouseEvent>(MAX_EVENTS);
    eventPool = new ReflectionPool<MouseEvent>(MouseEvent.class);

    shader = new ShaderProgram(
            Gdx.files.internal("assets/shaders/visualizer.vert"),
            Gdx.files.internal("assets/shaders/visualizer.frag"));
    if (!shader.isCompiled()) {
        Gdx.app.log("InputVisualizer", shader.getLog());
    }
    evBufferLoc = shader.getUniformLocation("u_mouseEvs[0]");
    projMatrixLoc = shader.getUniformLocation("u_projTrans");
    if (evBufferLoc == -1) {
        Gdx.app.log("InputVisualizer",
                "No uniform with name u_mouseEvents found in shader");
    }
    mesh = new Mesh(false, 4, 4, VertexAttribute.Position());

    addListener(new MouseListener());
}
项目:Planetbase    文件:PooledEngine.java   
public void free (Object object) {
    if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
    }

    ReflectionPool pool = pools.get(object.getClass());

    if (pool == null) {
        return; // Ignore freeing an object that was never retained.
    }

    pool.free(object);
}
项目:Ashley    文件:PooledEngine.java   
public void free(Object object) {
    if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
    }

    ReflectionPool pool = pools.get(object.getClass());

    if (pool == null) {
        return; // Ignore freeing an object that was never retained.
    }

    pool.free(object);
}
项目:gdx.automation    文件:InputStateTracker.java   
public InputStateTracker(InputRecorder inputRecorder) {
    this.recorder = inputRecorder;

    int toSet = 0;
    if (recorder.getConfiguration().recordButtons) {
        toSet |= InputProperty.SyncProperty.Type.BUTTONS.key;
    }
    if (recorder.getConfiguration().recordOrientation) {
        toSet |= InputProperty.SyncProperty.Type.ORIENTATION.key;
    }
    if (recorder.getConfiguration().recordKeysPressed) {
        toSet |= InputProperty.SyncProperty.Type.KEYS_PRESSED.key;
    }
    if (recorder.getConfiguration().recordPointers) {
        toSet |= InputProperty.SyncProperty.Type.POINTERS.key;
    }
    beforePrcessEventsTrackFlags = toSet;

    toSet = 0;
    if (recorder.getConfiguration().recordKeyEvents) {
        toSet |= InputProperty.SyncProperty.Type.KEY_EVENTS.key;
    }
    if (recorder.getConfiguration().recordPointerEvents) {
        toSet |= InputProperty.SyncProperty.Type.POINTER_EVENTS.key;
    }
    onProcessEventsTrackFlags = toSet;

    storedStates = new ArrayList<InputState>();
    processedStates = new ArrayList<InputState>();

    statePool = new ReflectionPool<InputState>(InputState.class, 50);
    processor = new Processor();

    tracker = new Tracker();

    grabber = new InputEventGrabber();
    grabberArmer = new GrabberArmer();
    grabberKeeper = new GrabberKeeper();
}
项目:GDX-Logic-Bricks    文件:LogicBricksEngine.java   
public void free(D object) {
    if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
    }
    ReflectionPool pool = pools.get((Class<D>) object.getClass());
    if (pool == null) {
        return; // Ignore freeing an object that was never retained.
    }
    pool.free(object);

}
项目:ashley    文件:PooledEngine.java   
public void free (Object object) {
    if (object == null) {
        throw new IllegalArgumentException("object cannot be null.");
    }

    ReflectionPool pool = pools.get(object.getClass());

    if (pool == null) {
        return; // Ignore freeing an object that was never retained.
    }

    pool.free(object);
}
项目:Planetbase    文件:PooledEngine.java   
public ComponentPools (int initialSize, int maxSize) {
    this.pools = new ObjectMap<Class<?>, ReflectionPool>();
    this.initialSize = initialSize;
    this.maxSize = maxSize;
}
项目:Ashley    文件:PooledEngine.java   
public ComponentPools(int initialSize, int maxSize) {
    this.pools = new ObjectMap<Class<?>, ReflectionPool>();
    this.initialSize = 0;
    this.maxSize = 0;
}
项目:GDX-Logic-Bricks    文件:LogicBricksEngine.java   
public DataPools(int initialSize, int maxSize) {
    this.pools = new ObjectMap<Class<D>, ReflectionPool>();
    this.initialSize = 0;
    this.maxSize = 0;

}
项目:ashley    文件:PooledEngine.java   
public ComponentPools (int initialSize, int maxSize) {
    this.pools = new ObjectMap<Class<?>, ReflectionPool>();
    this.initialSize = initialSize;
    this.maxSize = maxSize;
}