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

[System.Serializable]
public class MonsterEntry
{
    public Transform Prefab;
    public int EarliestLevel;
    public int LastLevel;
}

public class MonsterLibrary : MonoBehaviour 
{
    public static MonsterLibrary instance;
    public List<MonsterEntry> Entries;

    void Start()
    {
        instance = this;
    }

    public Transform GetMonsterPrefab()
    {
        MonsterEntry mon = ListHelper.DrawFromAtRandom(
            Entries
            .Where(o => GameController.CurrentDepth >= o.EarliestLevel)
            .Where(q => GameController.CurrentDepth <= q.LastLevel)
            .ToList());

        return mon.Prefab;
    }

}
