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

import eu.mhsl.minenet.minigames.command.PrivilegedCommand;
import eu.mhsl.minenet.minigames.instance.room.Room;
import eu.mhsl.minenet.minigames.message.Icon;
import eu.mhsl.minenet.minigames.message.type.ChatMessage;
import net.minestom.server.command.builder.arguments.ArgumentType;
import net.minestom.server.entity.Player;

import java.util.UUID;

public class FakeplayerCommand extends PrivilegedCommand {
    public FakeplayerCommand() {
        super("fakeplayer");

        addSyntax((sender, context) -> {
            if(sender instanceof Player p) {
                if(p.getInstance() instanceof Room room) {
//                    FakePlayer.initPlayer( // TODO FakePlayer does no longer exists
//                        UUID.randomUUID(),
//                        context.getRaw("name"),
//                        new FakePlayerOption().setInTabList(true).setRegistered(true),
//                        fakePlayer -> Room.setRoom(fakePlayer, room)
//                    );
                } else {
                    new ChatMessage(Icon.ERROR).appendStatic("Du musst dich in einer Raumlobby befinden!").send(sender);
                }
            }
        }, ArgumentType.String("name"));
    }
}
