using UnityEngine;
using System.Collections;

[RequireComponent(typeof(AnimationManager))]
public class Demon : MonoBehaviour
{
    public enum State
    {
        Hidden,
        Appear,
        Idle,
        AttackTower,
        AttackDemon,
        Dying,
        Dead,
    }

    private AnimationManager _animationManager;
    private PlayerController _player;

    void Awake()
    {
        _animationManager = GetComponent<AnimationManager>();
    }

    // Use this for initialization
    void Start()
    {
    }

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

    }

    public void SetState(State state)
    {
        Debug.Log(name + ".SetState(" + state + ")");

        _animationManager.SetState((int)state);
    }

    public bool IsStateActive(State state)
    {
        Debug.Log(name + ".IsStateActive(" + state + ")");

        return _animationManager.IsStateActive((int)state);
    }

    public void SetPlayer(PlayerController player)
    {
        _player = player;
    }
}
