Easy corner for new wxBombers (as requested in patch #1178276).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-06 18:07:14 +00:00
parent 4377d3abc8
commit 43c3922bb0
4 changed files with 52 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ BombsGame::~BombsGame()
}
// Initialize the play field. Returns false on failure
bool BombsGame::Init(int aWidth, int aHeight)
bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
{
m_gridFocusX = m_gridFocusY = -1;
@@ -75,6 +75,15 @@ bool BombsGame::Init(int aWidth, int aHeight)
}
}
/* Force (0,0) not to have a bomb for those that don't want to have
to guess on the first move. Better would be to for the MS rule that
whatever is picked first isn't a bomb.
*/
if(easyCorner)
{
m_field[0] = BG_HIDDEN;
}
m_numBombCells = 0;
for(x=0; x<m_width; x++)
for(y=0; y<m_height; y++)