Back to project page hiddenmarble.
The source code is released under:
Apache License
If you think the Android project hiddenmarble listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mygdx.hiddenmarble.entities; //from ww w .j a v a2s. c om import java.util.HashMap; import java.util.Map; /** Material types for game entities. */ public enum Material { GLASS, METAL, WOOD; private static Map<Class<? extends Entity>, Material> table = new HashMap<Class<? extends Entity>, Material>(); static { table.put(DefaultBorders.class, GLASS); table.put(DefaultMarble.class, METAL); table.put(DefaultMazeBox.class, WOOD); } /** Returns the material type for the specified entity. */ public static Material getType(Entity entity) { return table.get(entity.getClass()); } }