using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "GameEvent_JobData", menuName = "Wavefunction/Event/New GameEvent JobData", order = 1)]
public class GameEvent_JobData : ScriptableObject
{
    private List<GameEventListener_JobData> listeners = new List<GameEventListener_JobData>();

    public void Raise(JobData jobData)
    {
        for (int i = listeners.Count - 1; i >= 0; i--)
        {
            listeners[i].OnEventRaised(jobData);
        }
    }

    public void RegisterListener(GameEventListener_JobData listener)
    {
        listeners.Add(listener);
    }

    public void UnRegisterListener(GameEventListener_JobData listener)
    {
        listeners.Remove(listener);
    }
}
