using System.Collections;
using System.Collections.Generic;
using UnityEngine;

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

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

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

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