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

import eu.mhsl.minenet.minigames.instance.game.Game;
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.restriction.RestrictionHandler;
import eu.mhsl.minenet.minigames.instance.game.stateless.config.restriction.common.MinimalPlayeramountGameRestriction;
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 BedwarsFactory implements GameFactory {
    @Override
    public TranslatedComponent name() {
        return TranslatedComponent.byId("game_Bedwars#name");
    }

    @Override
    public RestrictionHandler globalRestrictions() {
        return new RestrictionHandler()
                .addRestriction(new MinimalPlayeramountGameRestriction(1));
    }

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

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

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