[Fix] UI Logic
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user