aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications/ShiftSweeper.cs
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-02-26 21:37:06 -0500
committerlempamo <[email protected]>2017-02-26 21:37:06 -0500
commite1ddab3900172890bf38e1e2998a469dc77e1630 (patch)
tree8353cdc3a89a1952dee088cac227ac4b2c4ea6e9 /ShiftOS.WinForms/Applications/ShiftSweeper.cs
parentc37f4a7874416ff68e2e75f50f1c6802c9e3bb20 (diff)
downloadshiftos_thereturn-e1ddab3900172890bf38e1e2998a469dc77e1630.tar.gz
shiftos_thereturn-e1ddab3900172890bf38e1e2998a469dc77e1630.tar.bz2
shiftos_thereturn-e1ddab3900172890bf38e1e2998a469dc77e1630.zip
finished shiftsweeper
Diffstat (limited to 'ShiftOS.WinForms/Applications/ShiftSweeper.cs')
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
index 4b83b3f..0aac2c1 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -24,6 +24,7 @@ namespace ShiftOS.WinForms.Applications
private int[,] minemap; //Represents status of tiles. 0-8 = how many mines surrounding. -1 = mine. -2 = flagged mine. -3 to -11 = flagged safe.
private Timer ticking = new Timer();
private int minetimer;
+ private TableLayoutPanel minefieldPanel;
public ShiftSweeper() { InitializeComponent(); }
@@ -34,6 +35,9 @@ namespace ShiftOS.WinForms.Applications
buttonH.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_hard");
ticking.Interval = 1000;
ticking.Tick += Ticking_Tick;
+ easyPanel.Visible = false;
+ mediumPanel.Visible = false;
+ hardPanel.Visible = false;
}
private void Ticking_Tick(object sender, EventArgs e)
@@ -74,21 +78,25 @@ namespace ShiftOS.WinForms.Applications
lbltime.Text = "Time: 0";
minetimer = 0;
ticking.Start();
+ if (minefieldPanel != null) minefieldPanel.Visible = false;
switch (d)
{
case 0:
+ minefieldPanel = easyPanel;
mineCount = 10;
minefieldPanel.ColumnCount = 9;
minefieldPanel.RowCount = 9;
break;
case 1:
+ minefieldPanel = mediumPanel;
mineCount = 40;
minefieldPanel.ColumnCount = 16;
minefieldPanel.RowCount = 16;
break;
case 2:
+ minefieldPanel = hardPanel;
mineCount = 99;
minefieldPanel.ColumnCount = 30;
minefieldPanel.RowCount = 16;
@@ -97,6 +105,7 @@ namespace ShiftOS.WinForms.Applications
default:
throw new NullReferenceException();
}
+ minefieldPanel.Visible = true;
origminecount = mineCount;
lblmines.Text = "Mines: " + mineCount.ToString();
buttonE.Enabled = false;