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

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

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

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

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