using UnityEngine;
using System.Collections;

[System.Serializable]
public class Item {

    public int id;
    public int type;
    public string name;
    

    public Item(string line) {
        string[] data = line.Split(',');
        this.id = int.Parse(data[0]);
        this.name = (data[1]);
        this.type = int.Parse(data[2]);


        
    }

    public Item(int id){
        this.cloneItem(ItemDictionary.getItemById(id));

    }

    public Item(Item i) {
        this.cloneItem(i);    
    }

    private void cloneItem(Item i) {
        this.id = i.id;
        this.name = i.name;
        this.type = i.type;
    
    }

    public override string ToString()
    {
        return "ID: " + this.id + " Type: " + this.type + " Name: " + this.name;
    }
}
