package net.voltexstudios.npcConversations.npc;

import lombok.Getter;
import lombok.Setter;
import net.voltexstudios.npcConversations.NPCConversations;
import net.voltexstudios.npcConversations.util.Type;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

import java.util.UUID;

@Getter
public class NPC implements Clickable {

    private final String name;
    private final UUID clickableEntity;
    @Setter private String backgroundStory;

    public NPC(String name, UUID clickableEntity, String backgroundStory) {
        this.name = name;
        this.clickableEntity = clickableEntity;
        this.backgroundStory = backgroundStory;
    }

    public NPC(String name, UUID clickableEntity) {
        this.name = name;
        this.clickableEntity = clickableEntity;
        this.backgroundStory = generateGenericBackgroundStory();
    }

    private String generateGenericBackgroundStory() {
        return  "Hello! I am " + this.name + ". I am a friendly NPC Assistant on this Minecraft Server. I am here to help you with your requests!";
    }

    @Override
    public void onClick(Player player) {
        NPCConversations.startConversation(player, this, Type.SINGLE);
    }
}
