Fixed bug in the module generator config.

This commit is contained in:
Speiger 2022-12-04 08:00:31 +01:00
parent b29874189c
commit f53d61a5bc
4 changed files with 86 additions and 1 deletions

View File

@ -13,6 +13,87 @@
"Base": {
"enabled": true
},
"Boolean": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Byte": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Short": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Character": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Integer": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Long": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Float": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Double": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Object": {
"enabled": true,
"Function": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Collection": {
"enabled": true
},

View File

@ -54,8 +54,8 @@ public class SettingsManager
data.addProperty(moduleName, true);
if(module.isBiModule()) {
for(ClassType keyType : ModulePackage.TYPE) {
if(keyType == ClassType.BOOLEAN) continue;
for(ClassType valueType : ModulePackage.TYPE) {
if(!module.isModuleValid(keyType, valueType)) continue;
JsonObject obj = new JsonObject();
obj.addProperty("enabled", true);
for(String key : module.getModuleKeys(keyType, valueType)) {
@ -67,6 +67,7 @@ public class SettingsManager
return;
}
for(ClassType keyType : ModulePackage.TYPE) {
if(!module.isModuleValid(keyType, keyType)) continue;
JsonObject obj = new JsonObject();
obj.addProperty("enabled", true);
for(String key : module.getModuleKeys(keyType, keyType)) {

View File

@ -57,6 +57,7 @@ public abstract class BaseModule
public abstract String getModuleName();
public boolean isBiModule() { return false; }
public Set<String> getModuleKeys(ClassType keyType, ClassType valueType) { return Collections.emptySet(); }
public boolean isModuleValid(ClassType keyType, ClassType valueType) { return true; }
protected boolean isModuleEnabled() {
return manager == null || manager.isModuleEnabled(this, keyType, valueType);

View File

@ -13,6 +13,8 @@ public class MapModule extends BaseModule
protected void loadVariables() {}
@Override
protected void loadFlags() {}
@Override
public boolean isModuleValid(ClassType keyType, ClassType valueType) { return keyType != ClassType.BOOLEAN; }
@Override
protected void loadBlockades()