@ -26,6 +26,10 @@ public class PropertyMgr {
return props.get(key);
}
public static String getString(String key) {
return (String) get(key);
public static void main(String[] args) {
System.out.println(get("initTankCount"));
@ -14,7 +14,7 @@ public class TankDemo {
TankFrame tankFrame = new TankFrame();
Random random = new Random();
int initTankCount = Integer.parseInt((String) PropertyMgr.get("initTankCount"));
int initTankCount = Integer.parseInt(PropertyMgr.getString("initTankCount"));
//创建5个敌方坦克
for (int i=0; i<initTankCount; i++) {