using UnityEngine;
using System.Collections;

public class BasicScript : MonoBehaviour {

    private MarksScript _marksScript;
    private Animator _animator;

	// Use this for initialization
	void Start () {
        _marksScript = GetComponentInChildren<MarksScript>(true);
        _animator = GetComponent<Animator>();
	}
	
	// Update is called once per frame
	void Update () {
	    
	}

    public void ReceiveAction(int action, MilitarBasic.Intentions intention, GameObject go)
    {
        _marksScript.setMarkAnimation(action);

        switch(intention)
        {
            case MilitarBasic.Intentions.TAKE_OUT:
                // Dejamos de estar en la cola
                Destroy(GetComponent<QueueScript>());
                // Nos sacan a la fuerza
                gameObject.AddComponent<TakeOut>();
                GetComponent<TakeOut>().from = go;
                break;
        }
    }

    public void Die()
    {
        _animator.SetInteger("Special", 1);
    }
}
