1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-02 03:18:09 -09:00

Added default configuration for ai-ma.

Now it can be loaded as runtime dependency.
This commit is contained in:
North 2012-08-26 18:55:23 +03:00
parent 0589ef94cb
commit 73642f6649

View file

@ -57,7 +57,18 @@ public class Config2 {
Properties p = new Properties();
try {
File file = new File(Config2.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
p.load(new FileInputStream(new File(file.getParent() + File.separator + "AIMinimax.properties")));
File propertiesFile = new File(file.getParent() + File.separator + "AIMinimax.properties");
if (propertiesFile.exists()) {
p.load(new FileInputStream(propertiesFile));
} else {
// p.setProperty("maxDepth", "10");
p.setProperty("maxNodes", "5000");
p.setProperty("evaluatorLifeFactor", "2");
p.setProperty("evaluatorPermanentFactor", "1");
p.setProperty("evaluatorCreatureFactor", "1");
p.setProperty("evaluatorHandFactor", "1");
// p.setProperty("maxThinkSeconds", "30");
}
} catch (IOException ex) {
logger.log(Level.SEVERE, null, ex);
} catch (URISyntaxException ex) {