using UnityEngine;
using System.Collections.Generic;

public class SelfDestruct : MonoBehaviour {

    public int CountDown = 1;
    public int count = 0;
    private Actor actor;

    void Start()
    {
        Debug.Log(name + " starting ");
        actor = GetComponent<Actor>();
    }

    void PlanTurn(List<TurnAction> actions)
    {
        if (count < CountDown)
        {
            count++;
            Debug.Log(name + " Counting down " + count + " / " + CountDown);
            actions.Add(new ActionWait());
        }
        else
        {
            actions.Add(new ActionWait());
            //GetComponent<Actor>().Die();
            actor.Die();
        }
    }
}
