package eu.midnightdust.yaytris;

import eu.midnightdust.yaytris.util.Difficulty;
import eu.midnightdust.yaytris.util.Language;
import eu.midnightdust.yaytris.util.NightJson;

import java.util.Arrays;

public class Settings {
    private static final NightJson json = new NightJson(Settings.class, "tetris_settings.json5");

    public static NightJson.Comment c1 = new NightJson.Comment("Volume of theme music (0-100)");
    public static int musicVolume = 100;
    public static NightJson.Comment c2 = new NightJson.Comment("Volume of sound effects (0-100)");
    public static int soundVolume = 100;
    public static NightJson.Comment c3 = new NightJson.Comment("Amount the user interface should be scaled");
    public static float guiScale = 3.f;
    public static NightJson.Comment c4 = new NightJson.Comment("Whether speed should scale with level (true/false)");
    public static boolean shouldScaleSpeed = true;
    public static NightJson.Comment c5 = new NightJson.Comment("One of %s", Arrays.toString(Difficulty.values()));
    public static Difficulty difficulty = Difficulty.NORMAL;
    public static NightJson.Comment c6 = new NightJson.Comment("One of %s", Arrays.toString(Language.values()));
    public static Language language = Language.ENGLISH;

    public static void load() {
        json.readJson();
    }

    public static void write() {
        json.writeJson();
    }
}
