Third part of patch #1178276 and game improvements.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-16 15:32:04 +00:00
parent 3ac88cb5cb
commit 709d008161
3 changed files with 60 additions and 46 deletions

View File

@@ -99,6 +99,7 @@ bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
}
m_numRemainingCells = m_height*m_width-m_numBombCells;
m_numMarkedCells = 0;
return true;
}
@@ -106,15 +107,22 @@ bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
void BombsGame::Mark(int x, int y)
{
m_field[x+y*m_width] ^= BG_MARKED;
if (IsMarked(x, y))
m_numMarkedCells++;
else
m_numMarkedCells--;
}
void BombsGame::Unhide(int x, int y)
void BombsGame::Unhide(int x, int y, bool b_selected)
{
if (!IsHidden(x,y))
{
return;
}
if (b_selected)
m_field[x+y*m_width] |= BG_SELECTED;
m_field[x+y*m_width] &= ~BG_HIDDEN;
if (!IsBomb(x,y))