package creator;

import java.util.HashMap;

public enum SKilLTypes {
	Bool("skill.lang.bool", "boolean"),
	Integer8("skill.lang.i8","byte"),
	Integer16("skill.lang.i16","short"),
	Integer32("skill.lang.i32","int"),
	Integer64("skill.lang.i64","long"),
	VariableInt64("skill.lang.v64","java.math.BigInteger"),
	Float32("skill.lang.f32","float"),
	Float64("skill.lang.f64","double"),
	Array("skill.lang.array","array"),
	List("skill.lang.list","java.util.ArrayList"),
	Set("skill.lang.set","java.util.HashSet"),
	Map("skill.lang.map","java.util.HashMap"),
	String("skill.lang.string","java.lang.String"),
	Annotation("skill.lang.annotation","annotation");

	private String skillType;
	private String javaType;
	private static HashMap<String, String> typeMapping;
	static {
		typeMapping.put("skill.lang.bool", "boolean");
		typeMapping.put("skill.lang.i8", "byte");
		typeMapping.put("skill.lang.i16", "short");
		typeMapping.put("skill.lang.i32", "int");
		typeMapping.put("skill.lang.i64", "long");
		typeMapping.put("skill.lang.v64", "java.math.BigInteger");
		typeMapping.put("skill.lang.f32", "float");
		typeMapping.put("skill.lang.f64", "double");
		typeMapping.put("skill.lang.array", "array");
		typeMapping.put("skill.lang.list", "java.util.ArrayList");
		typeMapping.put("skill.lang.set", "java.util.HashSet");
		typeMapping.put("skill.lang.map", "java.util.HashMap");
		typeMapping.put("skill.lang.string", "java.lang.String");
		typeMapping.put("skill.lang.annotation", "annotation");
	}

	SKilLTypes(String skillType, String javaType) {
		this.skillType = skillType;
		this.javaType = javaType;
	}
	
	public static String getJavaType(String skillType){
		return typeMapping.get(skillType);
	}
	
}

@@ -59,17 +59,16 @@
 KilLType
-s
  %7B%0A%09Bool
@@ -85,27 +85,16 @@
 ng.bool%22
-, %22boolean%22
 ),%0A%09Inte
@@ -117,15 +117,8 @@
 .i8%22
-,%22byte%22
 ),%0A%09
@@ -147,16 +147,8 @@
 i16%22
-,%22short%22
 ),%0A%09
@@ -177,14 +177,8 @@
 i32%22
-,%22int%22
 ),%0A%09
@@ -207,15 +207,8 @@
 i64%22
-,%22long%22
 ),%0A%09
@@ -241,31 +241,8 @@
 v64%22
-,%22java.math.BigInteger%22
 ),%0A%09
@@ -269,16 +269,8 @@
 f32%22
-,%22float%22
 ),%0A%09
@@ -297,17 +297,8 @@
 f64%22
-,%22double%22
 ),%0A%09
@@ -325,16 +325,8 @@
 ray%22
-,%22array%22
 ),%0A%09
@@ -351,30 +351,8 @@
 ist%22
-,%22java.util.ArrayList%22
 ),%0A%09
@@ -375,28 +375,8 @@
 set%22
-,%22java.util.HashSet%22
 ),%0A%09
@@ -399,28 +399,8 @@
 map%22
-,%22java.util.HashMap%22
 ),%0A%09
@@ -429,27 +429,8 @@
 ing%22
-,%22java.lang.String%22
 ),%0A%09
@@ -467,21 +467,8 @@
 ion%22
-,%22annotation%22
 );%0A%0A
@@ -498,34 +498,8 @@
 pe;%0A
-%09private String javaType;%0A
 %09pri
@@ -978,21 +978,35 @@
 rray%22, %22
-array
+java.util.ArrayList
 %22);%0A%09%09ty
@@ -1041,37 +1041,38 @@
 st%22, %22java.util.
-Array
+Linked
 List%22);%0A%09%09typeMa
@@ -1283,26 +1283,32 @@
 tion%22, %22
-annotation
+java.lang.Object
 %22);%0A%09%7D%0A%0A
@@ -1317,17 +1317,16 @@
 KilLType
-s
 (String 
@@ -1338,25 +1338,8 @@
 Type
-, String javaType
 ) %7B%0A
@@ -1372,36 +1372,8 @@
 pe;%0A
-%09%09this.javaType = javaType;%0A
 %09%7D%0A%09
@@ -1468,10 +1468,207 @@
 );%0A%09%7D%0A%09%0A
+%09public static SKilLType fromString(String type)%7B%0A%09%09for(SKilLType currentType : SKilLType.values())%7B%0A%09%09%09if(currentType.skillType.equals(type))%7B%0A%09%09%09%09return currentType;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%09%0A
 %7D%0A

Add fromString method to enum