using UnityEngine;
using System.Collections;

public class NPC : MonoBehaviour {

    Ritual[] rituals;

	void Awake () {
        rituals = GetComponents<Ritual>();
	}
	
	// Update is called once per frame
	void Update () {
        if (Input.GetKey(KeyCode.T))
        {
            doActionFour();
        }
        if (Input.GetKey(KeyCode.G))
        {
            doActionFive();
        }
    }

    private void ActivateRitual(string ritualName)
    {
        if (this.enabled)
        {
            foreach (Ritual ritual in rituals)
            {
                if (ritual.GetType().ToString() == ritualName)
                {
                    ritual.enabled = true;
                }
                else
                {
                    ritual.enabled = false;
                }

            }
        }
    }

    public void doActionOne()
    {
        ActivateRitual("SortingRitual");
    }

    public void doActionTwo()
    {
        ActivateRitual("MarchingRitual");
    }

    public void doActionThree()
    {
        ActivateRitual("WhirlingRitual");
    }

    public void doActionFour()
    {
        ActivateRitual("TorchRitual");
    }

    public void doActionFive()
    {
        ActivateRitual("GenuflexionRitual");
    }
}
