X-Git-Url: http://git.sourceforge.jp/view?p=chemicraft%2Fchemicraft.git;a=blobdiff_plain;f=common%2Fchemicraft%2FChemiCraftAPI.java;h=5f1a89268562d0358c51f017bc60358bfdb8169c;hp=5630753a360777afe384caf945d2c45dbcb11cae;hb=4773a545483a2c8a293618094dfa06c1215d1846;hpb=937955a20e1f5608cc7526f962297f1a4ea051c6;ds=inline diff --git a/common/chemicraft/ChemiCraftAPI.java b/common/chemicraft/ChemiCraftAPI.java index 5630753..5f1a892 100644 --- a/common/chemicraft/ChemiCraftAPI.java +++ b/common/chemicraft/ChemiCraftAPI.java @@ -1,50 +1,73 @@ -package chemicraft; +package chemicraft; import java.util.ArrayList; public class ChemiCraftAPI { + /** + * Instance of the ChemiCraftAPI. + */ public static ChemiCraftAPI instance = new ChemiCraftAPI(); - private boolean addLanguage = false; + /** + * List of compounds names. + */ private static ArrayList compoundsNameList = new ArrayList(); + + /** + * List of compounds names(Some kind of language). + */ private static ArrayList compoundsLangNameList = new ArrayList(); + + /** + * List of compounds the language names. + */ private static ArrayList compoundsLangList = new ArrayList(); + + /** + * List of compounds handlers. + */ private static ArrayList compoundHandlers = new ArrayList(); + + /** + * List of item name of handler to compounds. + */ private static ArrayList compoundHandlerItemNames = new ArrayList(); + /** + * add compound. + * @param name compound name. + */ public static void addCompound(String name){ compoundsNameList.add(name); compoundsLangNameList.add(""); compoundsLangList.add(""); } + /** + * add compound corresponding to the language. + * @param lang Language to the corresponding + * @param englishName compound name + * @param langName compound name(specified language) + */ public static void addLangCompound(String lang, String englishName, String langName){ compoundsNameList.add(englishName); compoundsLangNameList.add(langName); compoundsLangList.add(lang); } - public static ArrayList getCompoundsName(){ - compoundsNameList.trimToSize(); - return compoundsNameList; - } - - public static ArrayList getCompoundsLangName(){ - compoundsLangNameList.trimToSize(); - return compoundsLangNameList; - } - - public static ArrayList getCompoundsLang(){ - compoundsLangList.trimToSize(); - return compoundsLangList; - } - - public static void addCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){ + /** + * setting compound handler. + * @param handlerItemName + * @param compoundHandler + */ + public static void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){ ChemiCraftAPI.compoundHandlers.add(compoundHandler); compoundHandlerItemNames.add(handlerItemName); } + //ˆÈ~ƒVƒXƒeƒ€ŠÖŒW‚̃ƒ\ƒbƒh////////////////////////////////////////////////////// + public static ArrayList getCompoundHandler(){ compoundHandlers.trimToSize(); return compoundHandlers; @@ -56,4 +79,19 @@ public class ChemiCraftAPI { return compoundHandlerItemNames; } + public static ArrayList getCompoundsName(){ + compoundsNameList.trimToSize(); + return compoundsNameList; + } + + public static ArrayList getCompoundsLangName(){ + compoundsLangNameList.trimToSize(); + return compoundsLangNameList; + } + + public static ArrayList getCompoundsLang(){ + compoundsLangList.trimToSize(); + return compoundsLangList; + } + }