this.quadMap = quadMap;
}
public void load(Registry quadMapRegistry, Registry overlapRegistry)
throws RulesetException {
Messages messages = Messages.getMessages();
Ruleset settingsRuleset = quadMapRegistry.getRuleset("settings");
Section gensection = settingsRuleset.getSection("general");
Section paintingSection = settingsRuleset.getSection("painting");
String whichWFPainterString = paintingSection.getField("whichWFPainter").getStringValue();
if (whichWFPainterString.equals("LineEdgeWFPainter")) {
quadMap.setWFPainter(new LineEdgeWFPainter());
} else if (whichWFPainterString.equals("CircleWFPainter")) {
quadMap.setWFPainter(new CircleWFPainter());
} else if (whichWFPainterString.equals("None")) {
quadMap.setWFPainter(null);
} else {
messages.info("QuadMap.Config", "QMapConf", "FallDefault", whichWFPainterString +
" is not a valid WorkingFieldPainter");
messages.info("QuadMap.Config", "QMapConf", "FallDefault",
"--> Using LineEdgeWFPainter as a default");
quadMap.setWFPainter(new LineEdgeWFPainter());
}
String whichFMString = paintingSection.getField("whichFMPainter").getStringValue();
if (whichFMString.equals("LineEdge")) {
quadMap.setFMPainter(new LineEdgeFMPainter());
} else if (whichWFPainterString.equals("None")) {
quadMap.setFMPainter(null);
} else {
messages.info("QuadMap.Config", "QMapConf", "FallDefault", whichWFPainterString +
" is not a valid WorkingFieldPainter");
messages.info("QuadMap.Config", "QMapConf", "FallDefault",
"--> Using LineEdge as a default");
quadMap.setFMPainter(new LineEdgeFMPainter());
}
String whichTerrainOM = paintingSection.getField("whichTerrainOverlapManager")
.getStringValue();
TerrainOverlapManager omManager;
if (whichTerrainOM.equals("Random")) {
// hack for now
omManager = null;
// omManager = new RandomTerrainOverlapManager(quadMap.getGameData(),
// overlapRegistry);
} else if (whichTerrainOM.equals("None")) {
omManager = null;
} else {
messages.info("QuadMap.Config", "QMapConf", "FallDefault", whichTerrainOM +
" is not a valid TerrainOverlapManager");
messages.info("QuadMap.Config", "QMapConf", "FallDefault",
"--> Using RandomTerrainOverlapManager as a default!");
omManager = new RandomTerrainOverlapManager(quadMap.getGameData(),
overlapRegistry);
}
quadMap.setTerrainOverlapManager(omManager);
Section mpSection = settingsRuleset.getSection("movePaths");
displayMovePaths = mpSection.getField("display").getBoolValue();
mpGestLength = mpSection.getField("gestLength").getIntValue();
mpMarkTurnEnds = mpSection.getField("markTurnEnds").getBoolValue();
mpTurnEndArcRadius = mpSection.getField("turnEndArcRadius").getIntValue();
mpDisplaySpeed = mpSection.getField("displaySpeed").getBoolValue();
String tdmString = mpSection.getField("turnDisplayMode").getStringValue();
if (tdmString.equals("none")) {
mpTurnDisplayMode = MP_TDM_NONE;
} else if (tdmString.equals("relativeTurns")) {
mpTurnDisplayMode = MP_TDM_RELATIVE_TURNS;
} else if (tdmString.equals("absoluteTurns")) {
mpTurnDisplayMode = MP_TDM_ABSOLUTE_TURNS;
} else if (tdmString.equals("years")) {
mpTurnDisplayMode = MP_TDM_YEARS;
} else {
messages.info("QuadMap.Config", "QMapConf", "FallDefault",
"section movePaths, field turnDisplayMode:");
messages.info("QuadMap.Config", "QMapConf", "FallDefault",
"--> " + tdmString + " is no valid mode - assuming none "
+ "(display nothing)");
mpTurnDisplayMode = MP_TDM_NONE;
}
mpDisplayTime = mpSection.getField("displayTime").getBoolValue();