/** * Initializes the BufferBciController instance. */ public BufferBciController() { this.buttons = new ArrayList<BufferBciButton>(); this.axes = new ArrayList<BufferBciAxis>(); this.controllerListeners = new ArrayList<ControllerListener>(); this.unprocessedEvents = new ArrayList<BufferEvent>(); }
/** * Called whenever a button is updated. * @param btn */ private void onButtonUpdated(BufferBciButton btn) { // Inform listeners. for (ControllerListener cl : controllerListeners) { if (btn.activated) { cl.buttonDown(this, btn.code); } else { cl.buttonUp(this, btn.code); } } }
/** * Called whenever an axis is updated. * @param axis */ protected void onAxisUpdated(BufferBciAxis axis) { // Inform listeners. for (ControllerListener cl : controllerListeners) { cl.axisMoved(this, axis.code, axis.value); } }
@Override public void addListener(ControllerListener listener) { listeners.add(listener); }
@Override public void removeListener(ControllerListener listener) { listeners.removeValue(listener, true); }
@Override public void addListener(ControllerListener listener) { this.listeners.add(listener); }
@Override public void removeListener(ControllerListener listener) { this.listeners.removeValue(listener, true); }
public Array<ControllerListener> getListeners() { return listeners; }
@Override public void addListener (ControllerListener listener) { synchronized(eventQueue) { listeners.add(listener); } }
@Override public void removeListener (ControllerListener listener) { synchronized(eventQueue) { listeners.removeValue(listener, true); } }
@Override public void addListener (ControllerListener listener) { this.listeners.add(listener); }
@Override public void removeListener (ControllerListener listener) { this.listeners.removeValue(listener, true); }
public Array<ControllerListener> getListeners() { return this.listeners; }
@Override public void addListener(ControllerListener listener) { synchronized(eventQueue) { listeners.add(listener); } }
@Override public void removeListener(ControllerListener listener) { synchronized(eventQueue) { listeners.removeValue(listener, true); } }
public void addListener (ControllerListener listener) { listeners.add(listener); }
public void removeListener (ControllerListener listener) { listeners.removeValue(listener, true); }
@Override public void addListener(ControllerListener listener) { controllerListeners.add(listener); }
@Override public void removeListener(ControllerListener listener) { controllerListeners.remove(listener); }
@Override public void addListener(ControllerListener listener) { }
@Override public void removeListener(ControllerListener listener) { }