@Override
public void init(ADXGame game) {
// LoadĀ options
ADXIniParser ini = new ADXIniParser(optionPath);
if (ini.containsCategory("GLOBAL")) {
if (ini.containsKey("GLOBAL", "gridXSize")) {
gridXSize = ini.getIntValue("GLOBAL", "gridXSize");
}
if (ini.containsKey("GLOBAL", "gridYSize")) {
gridYSize = ini.getIntValue("GLOBAL", "gridYSize");
}
if (ini.containsKey("GLOBAL", "mapWidth")) {
mapWidth = ini.getIntValue("GLOBAL", "mapWidth");
}
if (ini.containsKey("GLOBAL", "mapHeight")) {
mapHeight = ini.getIntValue("GLOBAL", "mapHeight");
}
int assets = ini.getIntValue("GLOBAL", "assets");
String id;
for (int i = 0; i < assets; i++) {
id = "a" + i;
if (ini.containsCategory(id)) {
lAsset.add(new Asset(
ini.getIntValue(id, "id"),
ini.getValue(id, "name"),
ini.getValue(id, "path"),
ini.getIntValue(id, "canSpray") == 1,
ini.getIntValue(id, "canMultiple")
));
}
}
int layers = ini.getIntValue("GLOBAL", "layers");
for (int i = 0; i < layers; i++) {
id = "l" + i;
if (ini.containsCategory(id)) {
lLayer.add(new Layer(
ini.getIntValue(id, "id"),
ini.getValue(id, "name")
));
}
}
}