	public static void main(String[] args) throws IOException {
		List<FieldData> commonData = Lists.newArrayList();
		Multimap<String, FieldData> specificData = HashMultimap.create();
		File metaData = new File("./AbilityMetaData.csv");
		CsvReader reader = new CsvReader(new FileReader(metaData));
		reader.readHeaders();
		while (reader.readRecord()) {
			String id = reader.get("s");
			String displayName = strings.get(reader.get("displayName"));
			if (displayName == null) {
				displayName = reader.get("field");
			}
			String type = reader.get("type");
			int data = Integer.parseInt(reader.get("data"));
			boolean useLevels = !reader.get("repeat").equals("0");
			String useSpecific = reader.get("useSpecific");
			FieldData fd = new FieldData(id, displayName, type, data, useLevels);
			if (useSpecific.isEmpty()) {
				commonData.add(fd);
			} else {
				for (String spell : useSpecific.split("[,\\.]")) {
					specificData.put(spell, fd);
				}
			}
		}
		println("package AbilityObjEditing");
		println("import public ObjEditingNatives");
		println("");
		println("public class AbilityDefinition");
		println("	protected ObjectDefinition def");
		println("	");
		println("	construct(int newAbilityId, int origAbilityId)");
		println("		def = createObjectDefinition(\"w3a\", newAbilityId, origAbilityId)");
		Set<String> usedNames = Sets.newHashSet();
		for (FieldData fd : commonData) {
			fd.printFunc(usedNames);
		}
		for (String spell : specificData.keySet()) {
			usedNames.clear();
			println("");
			println("");
			println("");
			String spellName = abilityNames.get(spell);
			println("public class AbilityDefinition"+spellName+" extends AbilityDefinition");
			println("	construct(int newAbilityId)");
			println("		super(newAbilityId, '"+spell+"')");
			for (FieldData fd : specificData.get(spell)) {
				fd.printFunc(usedNames);
			}
		}
		System.out.println(sb.toString());
		Files.write(sb, new File("./AbilityObjEditing.wurst"), Charsets.UTF_8);
	}

	public static void main(String[] args) throws IOException {
		List<FieldData> commonData = Lists.newArrayList();
		Multimap<String, FieldData> specificData = HashMultimap.create();
		File metaData = new File("./AbilityMetaData.csv");
		CsvReader reader = new CsvReader(new FileReader(metaData));
		reader.readHeaders();
		while (reader.readRecord()) {
			String id = reader.get("ID");
			String displayName = strings.get(reader.get("displayName"));
			if (displayName == null) {
				displayName = reader.get("field");
			}
			String type = reader.get("type");
			int data = Integer.parseInt(reader.get("data"));
			boolean useLevels = !reader.get("repeat").equals("0");
			String useSpecific = reader.get("useSpecific");
			FieldData fd = new FieldData(id, displayName, type, data, useLevels);
			if (useSpecific.isEmpty()) {
				commonData.add(fd);
			} else {
				for (String spell : useSpecific.split("[,\\.]")) {
					specificData.put(spell, fd);
				}
			}
		}
		println("package AbilityObjEditing");
		println("import public ObjEditingNatives");
		println("");
		println("public class AbilityDefinition");
		println("	protected ObjectDefinition def");
		println("	");
		println("	construct(int newAbilityId, int origAbilityId)");
		println("		def = createObjectDefinition(\"w3a\", newAbilityId, origAbilityId)");
		Set<String> usedNames = Sets.newHashSet();
		for (FieldData fd : commonData) {
			fd.printFunc(usedNames);
		}
		for (String spell : specificData.keySet()) {
			usedNames.clear();
			println("");
			println("");
			println("");
			String spellName = abilityNames.get(spell);
			println("public class AbilityDefinition"+spellName+" extends AbilityDefinition");
			println("	construct(int newAbilityId)");
			println("		super(newAbilityId, '"+spell+"')");
			for (FieldData fd : specificData.get(spell)) {
				fd.printFunc(usedNames);
			}
		}
		System.out.println(sb.toString());
		Files.write(sb, new File("./AbilityObjEditing.wurst"), Charsets.UTF_8);
	}
