-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.java
More file actions
39 lines (26 loc) · 1009 Bytes
/
Copy pathConfig.java
File metadata and controls
39 lines (26 loc) · 1009 Bytes
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
package data;
import java.util.Properties;
public class Config {
public static final int ALL_WAR = 0;
public static final int WAR_MACHINE = 1;
// 游戏最大帧数
public static int FPS = 60;
// 是否显示权值分数
public static boolean ifShowWeightChess = false;
//记录选择的模式
public static int pattern = WAR_MACHINE;
// 是否第一次游戏
public static boolean ifFirstGame = false;
public static Properties getConfig() {
Properties config = new Properties();
config.put("FPS", String.valueOf(FPS));
config.put("ifShowWeightChess", String.valueOf(ifShowWeightChess));
config.put("pattern", String.valueOf(pattern));
return config;
}
public static void initConfig(Properties config) {
FPS = Integer.parseInt((String) config.get("FPS"));
ifShowWeightChess = Boolean.parseBoolean((String) config.get("ifShowWeightChess"));
pattern = Integer.parseInt((String) config.get("pattern"));
}
}