package zero1hd.rhythmbullet.util;

import com.badlogic.gdx.utils.Array;

public class MiniSender {
	private volatile Array<MiniListener> listeners;

	public MiniSender() {
		listeners = new Array<MiniListener>();
	}
	
	public synchronized void send(MiniEvents ID) {
		for (MiniListener listener : listeners) {
			listener.handle(ID);
		}
	}
	
	public synchronized void addListener(MiniListener handler) {
		listeners.add(handler);
	}
	
	public synchronized void removeListener(MiniListener listener) {
		listeners.removeValue(listener, true);
	}
}
