public void ResetGame() { isGameOver = false; GameData.ListCells.Clear(); GameData = new GameMatrix(settings.xAxis, settings.yAxis, settings.mines); GameData.InitialSetup(rand); updateGameboard(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); //Grid initialization gridGame = FindViewById <GridView>(Resource.Id.gridGame); //Imageview Initialization imgResetGame = FindViewById <ImageView>(Resource.Id.imgResetGame); imgflagCell = FindViewById <ImageView>(Resource.Id.imgflag); //Object with game settings settings = SetupGame.LoadGameSetup("easy"); //Max number of colums for the grid, equivalent to the horizontal spots gridGame.NumColumns = settings.xAxis; availableFlags = settings.mines; //All Game Data GameData = new GameMatrix(settings.xAxis, settings.yAxis, settings.mines); GameData.InitialSetup(rand); //List is sent to the Custom Adapter objCell = new deviget_minesweeper.ClassAdapters.CustomCellAdapter(GameData.ListCells, (AppCompatActivity)this); objCell.actionMenuSelected += ObjCell_actionMenuSelected; imgResetGame.Click += ImgResetGame_Click; imgflagCell.Click += ImgflagCell_Click; //Data populate to the GridView gridGame.Adapter = objCell; objCell.NotifyDataSetChanged(); }