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

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 BlockBattleFactory implements GameFactory {
    @Override
    public TranslatedComponent name() {
        return TranslatedComponent.byId("game_BlockBattle#name");
    }

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

    @Override
    public ConfigManager configuration() {
        return new ConfigManager()
            .addOption(new NumericOption("itemCount", Material.WHITE_WOOL, TranslatedComponent.byId("game_BlockBattle#itemCount"), 1, 2, 3));
    }

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

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