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

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

    public void Raise(List<RoomInfo> roomList)
    {
        for (int i = listeners.Count - 1; i >= 0; i--)
        {
            listeners[i].OnEventRaised(roomList);
        }
    }

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

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