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

import eu.mhsl.minenet.minigames.instance.game.Game;
import eu.mhsl.minenet.minigames.instance.room.Room;
import net.minestom.server.command.builder.Command;
import net.minestom.server.entity.Player;

public class LeaveCommand extends Command {
    public LeaveCommand() {
        super("leave");

        setCondition((sender, commandString) -> ((Player) sender).getInstance() instanceof Game);

        setDefaultExecutor((sender, context) -> Room.setOwnRoom((Player) sender));
    }
}
