Refactoring
This commit is contained in:
parent
4f2b5cd940
commit
542667699e
@ -12,7 +12,7 @@ namespace MineSweeper
|
|||||||
public int loses { get; set; } = 0;
|
public int loses { get; set; } = 0;
|
||||||
}
|
}
|
||||||
private record Root(List<PlayerData> players);
|
private record Root(List<PlayerData> players);
|
||||||
private Root root;
|
private readonly Root root;
|
||||||
public Database()
|
public Database()
|
||||||
{
|
{
|
||||||
path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MineSweeper by H1K0");
|
path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MineSweeper by H1K0");
|
||||||
|
|||||||
3
Field.cs
3
Field.cs
@ -19,8 +19,7 @@
|
|||||||
throw new ArgumentException("The number of mines can not be negative.");
|
throw new ArgumentException("The number of mines can not be negative.");
|
||||||
if (nmines > input_width * input_height)
|
if (nmines > input_width * input_height)
|
||||||
throw new ArgumentException("The number of mines can not be greater than the number of all cells.");
|
throw new ArgumentException("The number of mines can not be greater than the number of all cells.");
|
||||||
width = input_width;
|
(width, height) = (input_width, input_height);
|
||||||
height = input_height;
|
|
||||||
size = width * height;
|
size = width * height;
|
||||||
cells = new List<Cell>();
|
cells = new List<Cell>();
|
||||||
for (int i = 0; i < size; i++)
|
for (int i = 0; i < size; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user