using System.Collections.Generic;
using UnityEngine;

public class NPCManager : MonoBehaviour
{
    public float minCompetency = 0f;
    public float maxCompetency = 1.0f;
    private int decimalPlaces = 1;
    public float competencyLevel;

    public static NPCManager instance;
    private List<float> repairUrgencies = new List<float>();

    // properties to store information about the selected tool
    public float SelectedToolDurability { get; private set; }
    public float SelectedToolRepairUrgency { get; private set; }

    private void Awake()
    {
        instance = this;
    }

    public float GetRandomCompetency()
    {
        competencyLevel = Random.Range(minCompetency, maxCompetency);
        competencyLevel = Mathf.Round(competencyLevel * Mathf.Pow(10, decimalPlaces)) / Mathf.Pow(10, decimalPlaces);
        Debug.Log("NPC Competency Level: " + competencyLevel);
        return competencyLevel;
    }

    // ReceiveRepairUrgency to store information about the selected tool
    public void ReceiveRepairUrgency(float urgency, Tool tool)
    {
        repairUrgencies.Add(urgency);
        SelectedToolDurability = tool.durability;
        SelectedToolRepairUrgency = tool.repairUrgency;
        Debug.Log("Selected Tool Durability: " + SelectedToolDurability);
        Debug.Log("Selected Tool Repair Urgency: " + SelectedToolRepairUrgency);
        PutNPCInQueue();
    }

}