using UnityEngine;
using System.Collections;

public class Item : MonoBehaviour {

    public string itemName;
    public bool isTied;
    public bool isCleared;
    bool isTouched;


    // Use this for initialization
    void Start ()
    {
        isTied = false;
        isCleared = false;
        isTouched = false;
        //game = FindObjectOfType<Game>();
    }

    public void SetIsTied(bool newBool)
    {
        isTied = newBool;
    }

    public void SetIsCleared(bool newBool)
    {
        isCleared = newBool;
    }

    public bool GetIsTied()
    {
        return isTied;
    }

    public bool GetIsCleared()
    {
        return isCleared;
    }

    void Inactive()
    {
        if (isTied == false)
        {
            //wash away item
            SetIsCleared(true);
            gameObject.SetActive(false);
        }
        isTouched = false;
    }

    void OnParticleCollision(GameObject other)
    {
        float timeDelay = 0.5f;
        if (isTouched == false)
        {
            Invoke("Inactive", timeDelay);
            isTouched = true;
        }
    }

    // Update is called once per frame
    void Update ()
    {
	
	}
}
