using UnityEngine;

namespace Minesweeper.Config
{
    [CreateAssetMenu(fileName = "MinesweeperGameConfig", menuName = "Minesweeper/Game Config")]
    public sealed class MinesweeperGameConfig : ScriptableObject
    {
        [field: SerializeField, Min(1)] public int MinSizeX { get; private set; } = 2;
        [field: SerializeField, Min(1)] public int MaxSizeX { get; private set; } = 50;
        [field: SerializeField, Min(1)] public int MinSizeY { get; private set; } = 2;
        [field: SerializeField, Min(1)] public int MaxSizeY { get; private set; } = 50;

        public bool IsValid => MinSizeX > 0 && MinSizeY > 0 && MaxSizeX >= MinSizeX && MaxSizeY >= MinSizeY && MaxSizeX * MaxSizeY > 1;
    }
}
