using UnityEngine;
using System.Collections.Generic;

public class ItemsManager : MonoBehaviour
{
    private static ItemsManager m_instance;
    public static ItemsManager Instance => m_instance;

    private void Awake()
    {
        if (m_instance != null && m_instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            m_instance = this;
            DontDestroyOnLoad(gameObject);
        }
    }

    [HideInInspector]
    public class Item
    {
        public Item(string _name, ushort _id)
        {
            m_name = _name;
            m_id = _id;
        }

        public string GetName => m_name;
        public ushort GetId => m_id;
        
        private string m_name;
        private ushort m_id;
    }

    private List<Item> m_items;
    public List<Item> GetItemsDb => m_items;

    void Start()
    {
        m_items = new List<Item>();
        
        m_items.Add(new Item("Metal Pipe", (ushort)ItemIdentifier.ItemsIdentifier.METAL_PIPE));       
        m_items.Add(new Item("Can", (ushort)ItemIdentifier.ItemsIdentifier.CAN));
        m_items.Add(new Item("Pizza box", (ushort)ItemIdentifier.ItemsIdentifier.PIZZA_BOX));
    }
}
