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

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

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

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

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