using UnityEngine;

namespace Minesweeper.Config
{
    [CreateAssetMenu(fileName = "MinesweeperGameConfig", menuName = "Minesweeper/Game Config")]
    public sealed class MinesweeperGameConfig : ScriptableObject
    {
        [field: SerializeField, Min(1)] public int Width { get; private set; } = 9;
        [field: SerializeField, Min(1)] public int Height { get; private set; } = 9;
        [field: SerializeField, Min(1)] public int MinesCount { get; private set; } = 10;
        [field: SerializeField] public KeyCode RestartKey { get; private set; } = KeyCode.R;

        public bool IsValid => Width > 0 && Height > 0 && MinesCount > 0 && MinesCount < Width * Height;
    }
}
