package net.alcuria.umbracraft.editor;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable;
import com.badlogic.gdx.utils.ObjectMap;

/** A helper function that contains several {@link TextureRegionDrawable} objects
 * to use in the editor.
 * @author Andrew Keturi */
public class Drawables {

	private static ObjectMap<String, TextureRegionDrawable> drawables;
	private static boolean initialized = false;

	/** Gets a drawable from the map
	 * @param name the name of the drawable
	 * @return the {@link TextureRegionDrawable} */
	public static TextureRegionDrawable get(String name) {
		if (!initialized) {
			init();
		}
		if (drawables.containsKey(name)) {
			return drawables.get(name);
		}
		throw new IllegalArgumentException("No drawable found with name: " + name);
	}

	/** Call to initialize all the drawables. */
	public static void init() {
		if (initialized) {
			return;
		}
		Texture texture = new Texture(Gdx.files.internal("editor/skin.png"));
		drawables = new ObjectMap<String, TextureRegionDrawable>();
		drawables.put("black", new TextureRegionDrawable(new TextureRegion(texture, 0, 0, 1, 1)));
		drawables.put("yellow", new TextureRegionDrawable(new TextureRegion(texture, 1, 0, 1, 1)));
		drawables.put("blue", new TextureRegionDrawable(new TextureRegion(texture, 2, 0, 1, 1)));

		initialized = true;
	}

	private Drawables() {
	}

}

@@ -427,16 +427,183 @@
 bles %7B%0A%0A
+%09public static class R %7B%0A%09%09public static final String black = %22black%22;%0A%09%09public static final String blue = %22blue%22;%0A%09%09public static final String yellow = %22yellow%22;%0A%09%7D%0A%0A
 %09private
@@ -662,16 +662,17 @@
 wables;%0A
+%0A
 %09private

Add drawable alias class