/////////////////////////////////////////////////////////////////////////////// // Name: bombs1.cpp // Purpose: Implementation of the class BombsGame // Author: P. Foggia 1996 // Modified by: Wlodzimierz Skiba (ABX) since 2003 // Created: 1996 // Copyright: (c) 1996 P. Foggia // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP # include "wx/wx.h" #endif #include "game.h" #include #include #define PROB 0.2 #ifndef RAND_MAX # define RAND_MAX INT_MAX #endif BombsGame::~BombsGame() { if (m_field) { delete[] m_field; } } // Initialize the play field. Returns false on failure bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner) { m_gridFocusX = m_gridFocusY = -1; int x, y; int xx, yy; if (m_field) { delete[] m_field; } m_field = new short[aWidth*aHeight]; if (!m_field) { m_width = m_height = 0; return false; } m_width = aWidth; m_height = aHeight; for(x=0; x=0 && xx=0 && yy