import java.util.HashMap; import java.util.Map; public class Config { private Map<String, String> settings = new HashMap<>(); public Config(String configContent) { String[] lines = configContent.split("\n"); for (String line : lines) { line = line.trim(); if (line.startsWith("[") || line.isEmpty() || line.startsWith("//")) { continue; } String[] parts = line.split("=", 2); if (parts.length == 2) { settings.put(parts[0].trim(), parts[1].trim()); } } } public String get(String key) { return settings.get(key); } public boolean isEnabled(String key) { String value = get(key); return value != null && value.equalsIgnoreCase("Enabled"); } public double getDouble(String key) { String value = get(key); if (value == null) return 0; try { return Double.parseDouble(value.replace("%", "")); } catch (NumberFormatException e) { return 0; } } public boolean getBoolean(String key) { String value = get(key); return value != null && value.equalsIgnoreCase("true"); } }