21 lines
739 B
C#
21 lines
739 B
C#
using UnityEngine;
|
|
|
|
namespace Minesweeper.Config
|
|
{
|
|
[CreateAssetMenu(fileName = "MinesweeperGameConfig", menuName = "Minesweeper/Game Config")]
|
|
public sealed class MinesweeperGameConfig : ScriptableObject
|
|
{
|
|
[SerializeField, Min(1)] private int width = 9;
|
|
[SerializeField, Min(1)] private int height = 9;
|
|
[SerializeField, Min(1)] private int minesCount = 10;
|
|
[SerializeField] private KeyCode restartKey = KeyCode.R;
|
|
|
|
public int Width => width;
|
|
public int Height => height;
|
|
public int MinesCount => minesCount;
|
|
public KeyCode RestartKey => restartKey;
|
|
|
|
public bool IsValid => width > 0 && height > 0 && minesCount > 0 && minesCount < width * height;
|
|
}
|
|
}
|