From 542667699e781482da92b99884c58fee6dbf542f Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Thu, 3 Mar 2022 18:04:49 +0300 Subject: [PATCH] Refactoring --- Database.cs | 2 +- Field.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Database.cs b/Database.cs index c490060..67d6796 100644 --- a/Database.cs +++ b/Database.cs @@ -12,7 +12,7 @@ namespace MineSweeper public int loses { get; set; } = 0; } private record Root(List players); - private Root root; + private readonly Root root; public Database() { path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MineSweeper by H1K0"); diff --git a/Field.cs b/Field.cs index 6237ad2..5d10daa 100644 --- a/Field.cs +++ b/Field.cs @@ -19,8 +19,7 @@ throw new ArgumentException("The number of mines can not be negative."); if (nmines > input_width * input_height) throw new ArgumentException("The number of mines can not be greater than the number of all cells."); - width = input_width; - height = input_height; + (width, height) = (input_width, input_height); size = width * height; cells = new List(); for (int i = 0; i < size; i++)