OSDN Git Service

5f1a89268562d0358c51f017bc60358bfdb8169c
[chemicraft/chemicraft.git] / common / chemicraft / ChemiCraftAPI.java
1 package chemicraft;
2
3 import java.util.ArrayList;
4
5 public class ChemiCraftAPI {
6
7         /**
8          * Instance of the ChemiCraftAPI.
9          */
10         public static ChemiCraftAPI instance = new ChemiCraftAPI();
11
12         /**
13          * List of compounds names.
14          */
15         private static ArrayList<String> compoundsNameList = new ArrayList();
16
17         /**
18          * List of compounds names(Some kind of language).
19          */
20         private static ArrayList<String> compoundsLangNameList = new ArrayList();
21
22         /**
23          * List of compounds the language names.
24          */
25         private static ArrayList<String> compoundsLangList = new ArrayList();
26
27         /**
28          * List of compounds handlers.
29          */
30         private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
31
32         /**
33          * List of item name of handler to compounds.
34          */
35         private static ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
36
37         /**
38          * add compound.
39          * @param name compound name.
40          */
41         public static void addCompound(String name){
42                 compoundsNameList.add(name);
43                 compoundsLangNameList.add("");
44                 compoundsLangList.add("");
45         }
46
47         /**
48          * add compound corresponding to the language.
49          * @param lang Language to the corresponding
50          * @param englishName compound name
51          * @param langName compound name(specified language)
52          */
53         public static void addLangCompound(String lang, String englishName, String langName){
54                 compoundsNameList.add(englishName);
55                 compoundsLangNameList.add(langName);
56                 compoundsLangList.add(lang);
57         }
58
59         /**
60          * setting compound handler.
61          * @param handlerItemName
62          * @param compoundHandler
63          */
64         public static void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
65                 ChemiCraftAPI.compoundHandlers.add(compoundHandler);
66                 compoundHandlerItemNames.add(handlerItemName);
67         }
68
69         //\88È\8d~\83V\83X\83e\83\80\8aÖ\8cW\82Ì\83\81\83\\83b\83h//////////////////////////////////////////////////////
70
71         public static ArrayList<ICompoundHandler> getCompoundHandler(){
72                 compoundHandlers.trimToSize();
73                 return compoundHandlers;
74
75         }
76
77         public static ArrayList<String> getCompoundHandlerItemName(){
78                 compoundHandlerItemNames.trimToSize();
79                 return compoundHandlerItemNames;
80         }
81
82         public static ArrayList<String> getCompoundsName(){
83                 compoundsNameList.trimToSize();
84                 return compoundsNameList;
85         }
86
87         public static ArrayList<String> getCompoundsLangName(){
88                 compoundsLangNameList.trimToSize();
89                 return compoundsLangNameList;
90         }
91
92         public static ArrayList<String> getCompoundsLang(){
93                 compoundsLangList.trimToSize();
94                 return compoundsLangList;
95         }
96
97 }