Initialize grid values in-line

This commit is contained in:
tverona1
2019-07-23 23:13:27 -07:00
parent 4d545de5bd
commit 06298e39a9
3 changed files with 3 additions and 9 deletions
+2 -2
View File
@@ -18,8 +18,8 @@ namespace QuestAppLauncher
[Serializable]
public class GridSize
{
public int rows;
public int cols;
public int rows = 3;
public int cols = 3;
}
public GridSize gridSize;
-6
View File
@@ -146,12 +146,6 @@ namespace QuestAppLauncher
private void ProcessGridSize()
{
// Make sure grid size have sane value
if (0 == this.config.gridSize.cols && 0 == this.config.gridSize.rows)
{
// If not initialized, default to 3x3
this.config.gridSize.cols = 3;
this.config.gridSize.rows = 3;
}
this.config.gridSize.cols = Math.Min(this.config.gridSize.cols, 10);
this.config.gridSize.cols = Math.Max(this.config.gridSize.cols, 1);
this.config.gridSize.rows = Math.Min(this.config.gridSize.rows, 50);