package eu.mhsl.minenet.minigames.command.privileged;

import eu.mhsl.minenet.minigames.command.PrivilegedCommand;
import eu.mhsl.minenet.minigames.instance.game.stateless.StatelessGame;
import net.minestom.server.entity.Player;

public class GameStopCommand extends PrivilegedCommand {
    public GameStopCommand() {
        super("gameStop");
        setDefaultExecutor((sender, context) -> {
            Player player = (Player) sender;
            if(player.getInstance() instanceof StatelessGame game) {
                game.stop();
            }
        });
    }
}
