package moe.oko.opennaw.util;

import moe.oko.opennaw.storage.NAWDatabase;
import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.ConfigurationSection;

public class ConfigHelper {
    private Configuration config;

    public ConfigHelper(Configuration config) {
        this.config = config;
    }

    //Damage a city takes when a point is striked
    public int cityDamageOnStrike() {
        return config.getConfigurationSection("city").getInt("damageOnStrike");
    }

    public NAWDatabase fetchDatabase() {
        ConfigurationSection cs = config.getConfigurationSection("sql");
        return new NAWDatabase(cs.getString("username"), cs.getString("password"), cs.getString("host"), cs.getInt("port"), cs.getString("database"));
    }
}
