using System;
using UnityEngine;

/// <summary>
/// ScriptableObject for storing a collection of all level prefab sets.
/// </summary>
/// <remarks>
/// This class is used to organize and initialize multiple level prefab sets.
/// </remarks>
[CreateAssetMenu(menuName = "All Level Prefab Set")]
public class LevelsSet : ScriptableObject
{
    public BlocksSet[] singleLevelSet;
    [NonSerialized] public int levelSize = 0;

    /// <summary>
    /// Initialize the level collection.
    /// </summary>
    /// <remarks>
    /// This method retrieves the size of the level collection and initializes each individual level prefab set.
    /// </remarks>
    public void InitializeLevelsSet()
    {
        // get level size
        levelSize = singleLevelSet.Length;
        for(int i = 0; i < levelSize; i++)
        {
            // initialize all single level prefab set
            singleLevelSet[i].InitializeBlocksSet();
        }
    }
}