using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using CorgiLabs.Utility;

public abstract class GhostEventSource : MonoBehaviour
{
    public int Points { get { return m_Points; } }

    [SerializeField] private int m_Points;

    // Update is called once per frame
    protected virtual void Start()
    {
        ServiceLocator.Get<GameManager>().ProvideEventSource(this);
    }

    public virtual void StartEvent()
    {
        GameManager gm = ServiceLocator.Get<GameManager>();

        Invoke("SendFail", gm.Settings.GetEventDuration(gm.Level));
    }

    private void SendFail()
    {
        EventManager.TriggerEvent<GhostEventSource>(EventID.GhostEventFail, this);
    }
}
