package de.eightbitboy.ecorealms.control;

import java.util.ArrayList;
import java.util.List;

public class ControlActionMapping {

	enum Action {
		LMB,
		RMB
	}

	public interface ActionListener {
		void action(Action action);
	}

	private static final ControlActionMapping INSTANCE = new ControlActionMapping();

	private List<ActionListener> listeners = new ArrayList<ActionListener>();

	private ControlActionMapping() {
	}

	public static ControlActionMapping getInstance() {
		return INSTANCE;
	}

	public static void subscribe(ActionListener listener) {
		INSTANCE.listeners.add(listener);
	}

	public void fireAction(Action action) {
		for (ActionListener listener : listeners) {
			listener.action(action);
		}
	}
}

@@ -152,16 +152,152 @@
 B,%0A%09%09RMB
+;%0A%0A%09%09public ActionInformation info() %7B%0A%09%09%09return ControlActionMapping.getActionInformation();%0A%09%09%7D%0A%09%7D%0A%0A%09public class ActionInformation %7B%0A
 %0A%09%7D%0A%0A%09pu
@@ -517,24 +517,97 @@
 stener%3E();%0A%0A
+%09private ActionInformation actionInformation = new ActionInformation();%0A%0A
 %09private Con
@@ -764,16 +764,16 @@
 ener) %7B%0A
-
 %09%09INSTAN
@@ -800,24 +800,123 @@
 tener);%0A%09%7D%0A%0A
+%09public static ActionInformation getActionInformation() %7B%0A%09%09return INSTANCE.actionInformation;%0A%09%7D%0A%0A
 %09public void

Prepare adding information to actions