package eu.mhsl.minenet.minigames.instance.game.stateless.types.jumpDive;

import eu.mhsl.minenet.minigames.instance.game.Game;
import eu.mhsl.minenet.minigames.instance.game.stateless.config.ConfigManager;
import eu.mhsl.minenet.minigames.instance.game.stateless.config.GameFactory;
import eu.mhsl.minenet.minigames.instance.game.stateless.config.Option;
import eu.mhsl.minenet.minigames.instance.game.stateless.config.common.NumericOption;
import eu.mhsl.minenet.minigames.instance.room.Room;
import eu.mhsl.minenet.minigames.message.component.TranslatedComponent;
import net.minestom.server.item.Material;

import java.util.Map;

public class JumpDiveFactory implements GameFactory {
    @Override
    public TranslatedComponent name() {
        return TranslatedComponent.byId("game_jumpDive#name");
    }

    @Override
    public TranslatedComponent description() {
        return TranslatedComponent.byId("game_jumpDive#description");
    }

    @Override
    public ConfigManager configuration() {
        return new ConfigManager()
            .addOption(new NumericOption("radius", Material.HEART_OF_THE_SEA, TranslatedComponent.byId("optionCommon#radius"), 5, 8, 10, 12, 14, 16))
            .addOption(new NumericOption("height", Material.SCAFFOLDING, TranslatedComponent.byId("optionCommon#height"), 30, 60, 90))
            .addOption(new NumericOption("timeLimit", Material.CLOCK, TranslatedComponent.byId("optionCommon#seconds"), 60, 120, 180, 240, 300));

    }

    @Override
    public Game manufacture(Room parent, Map<String, Option<?>> configuration) throws Exception {
        return new JumpDive(configuration.get("radius").getAsInt(), configuration.get("height").getAsInt(), configuration.get("timeLimit").getAsInt()).setParent(parent);
    }

    @Override
    public Material symbol() {
        return Material.WATER_BUCKET;
    }
}
