using UnityEngine;
using System.Collections;

public class Slot : MonoBehaviour
{
    public Item item;
    public Person person;
    public int index;

    public void setItem(Item item)
    {
        if (this.item != null)
        {
            this.item.reset();

            /*/ TODO: implement swap
            Slot farthestSlot = item.getFarthestSlot();
            if (farthestSlot == null || farthestSlot == this)
            {

            }
            else
            {
                farthestSlot.setItem(this.item);
            }//*/
        }

		item.transform.position = this.transform.position - item.offsetVector + new Vector3(0,0,-10f);
        item.slots.Clear();
        item.slots.Add(this);
        this.item = item;
    }
}
