parent
5451bafed3
commit
10c7e9c552
@ -0,0 +1,6 @@
|
||||
#tanks count at initialization
|
||||
initTankCount=10
|
||||
tankSpeed=5
|
||||
bulletSpeed=10
|
||||
gameWidth=1080
|
||||
gameHeight=720
|
@ -0,0 +1,33 @@
|
||||
package com.msb;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @Author bingor
|
||||
* @Date 2022-10-05 22:35
|
||||
* @Description: com.msb
|
||||
* @Version: 1.0
|
||||
*/
|
||||
public class PropertyMgr {
|
||||
|
||||
private static Properties props = new Properties();
|
||||
|
||||
static {
|
||||
try {
|
||||
props.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config.properties"));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static Object get(String key) {
|
||||
return props.get(key);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(get("initTankCount"));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue