OSDN Git Service

8e215d6cf71b114168782fa0fc2a2cbdf7e85d81
[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         /**
14          * List of compounds names.
15          */
16         private static ArrayList<String> compoundsNameList = new ArrayList();
17
18
19         /**
20          * List of compounds names(Some kind of language).
21          */
22         private static ArrayList<String> compoundsLangNameList = new ArrayList();
23
24
25         /**
26          * List of compounds the language names.
27          */
28         private static ArrayList<String> compoundsLangList = new ArrayList();
29
30
31         /**
32          * List of compounds handlers.
33          */
34         private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
35
36
37         /**
38          * List of item name of handler to compounds.
39          */
40         private static ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
41
42
43         /**
44          * add compound.
45          * @param name compound name.
46          */
47         public static void addCompound(String name){
48                 compoundsNameList.add(name);
49                 compoundsLangNameList.add("");
50                 compoundsLangList.add("");
51         }
52
53
54
55         /**
56          * add compound corresponding to the language.
57          * @param lang Language to the corresponding
58          * @param englishName compound name
59          * @param langName compound name(specified language)
60          */
61         public static void addLangCompound(String lang, String englishName, String langName){
62                 compoundsNameList.add(englishName);
63                 compoundsLangNameList.add(langName);
64                 compoundsLangList.add(lang);
65         }
66
67
68
69         /**
70          * setting compound handler.
71          * @param handlerItemName
72          * @param compoundHandler
73          */
74         public static void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
75                 ChemiCraftAPI.compoundHandlers.add(compoundHandler);
76                 compoundHandlerItemNames.add(handlerItemName);
77         }
78
79
80
81         //以下システム関連//////////////////////////////////////////////////////
82
83         public static ArrayList<ICompoundHandler> getCompoundHandler(){
84                 compoundHandlers.trimToSize();
85                 return compoundHandlers;
86
87         }
88
89
90
91         public static ArrayList<String> getCompoundHandlerItemName(){
92                 compoundHandlerItemNames.trimToSize();
93                 return compoundHandlerItemNames;
94         }
95
96
97
98         public static ArrayList<String> getCompoundsName(){
99                 compoundsNameList.trimToSize();
100                 return compoundsNameList;
101         }
102
103
104
105         public static ArrayList<String> getCompoundsLangName(){
106                 compoundsLangNameList.trimToSize();
107                 return compoundsLangNameList;
108         }
109
110
111
112         public static ArrayList<String> getCompoundsLang(){
113                 compoundsLangList.trimToSize();
114                 return compoundsLangList;
115         }
116
117 }