summaryrefslogtreecommitdiff
path: root/NET/worlds/core/IniFile.java
blob: 0502e08fe180dfd347da57a4fa48a96d9351fb1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package NET.worlds.core;

public class IniFile {
   String file;
   String section;
   static boolean initialized = false;
   private static IniFile gamma_ = null;
   private static IniFile override_ = null;

   public IniFile(String section) {
      this.file = null;
      this.section = section;
   }

   public IniFile(String inifileName, String section) {
      this.file = inifileName;
      this.section = section;
   }

   public static IniFile gamma() {
      if (gamma_ == null) {
         gamma_ = new IniFile("Gamma");
      }

      if (!initialized) {
         nativeInit();
         initialized = true;
      }

      return gamma_;
   }

   public static IniFile override() {
      if (!initialized) {
         nativeInit();
         initialized = true;
      }

      if (override_ == null) {
         override_ = new IniFile(".\\override.ini", "Runtime");
      }

      return override_;
   }

   public native int getIniInt(String var1, int var2);

   public native void setIniInt(String var1, int var2);

   public native String getIniString(String var1, String var2);

   public native void setIniString(String var1, String var2);

   public static native void nativeInit();
}