diff options
| author | lempamo <[email protected]> | 2017-08-03 10:45:51 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-08-03 10:45:51 -0400 |
| commit | 75d4f6c762aa5582c6c95518eb226a840559cf74 (patch) | |
| tree | b4ec927bd7967b545b38a27ddc4411213b588cc0 /TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs | |
| parent | 92410f8e3825950746c1d8d7230074c8a100c9cf (diff) | |
| parent | 970dabaa90a39623c7a8271239861a09af7b2b54 (diff) | |
| download | histacom2-75d4f6c762aa5582c6c95518eb226a840559cf74.tar.gz histacom2-75d4f6c762aa5582c6c95518eb226a840559cf74.tar.bz2 histacom2-75d4f6c762aa5582c6c95518eb226a840559cf74.zip | |
Merge branch 'master' of https://github.com/TimeHACKDevs/TimeHACK.git
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs index 8adee8e..fd6704a 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs @@ -16,10 +16,11 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private int _mines; private Panel _panel; private Square[,] _squares; - private Timer _timer; + public Timer _timer; private int _width; public bool ftime = true; public int Time; + public bool win = false; public Game(Panel panel, int width, int height, int mines) { @@ -27,15 +28,12 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper _width = width; _height = height; _mines = mines; + win = false; } private void Dismantle(object sender, EventArgs e) { - if(ftime == true) - { - ftime = false; - OnTick(); - } + Square s = (Square)sender; if (s.Dismantled) { @@ -66,6 +64,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper { _timer.Enabled = false; Panel.Enabled = false; + win = true; } } @@ -77,7 +76,6 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private void Explode(object sender, EventArgs e) { _timer.Enabled = false; - foreach (Square s in _squares) { s.RemoveEvents(); @@ -114,6 +112,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper protected void OnDismantledMinesChanged() { + if (DismantledMinesChanged != null) { DismantledMinesChanged(this, new EventArgs()); @@ -184,14 +183,9 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper } OnDismantledMinesChanged(); - - _timer = new Timer(); - _timer.Interval = 1000; - _timer.Tick += new EventHandler(TimerTick); - _timer.Enabled = true; } - private void TimerTick(object sender, EventArgs e) + public void TimerTick(object sender, EventArgs e) { Time++; OnTick(); |
