示例#1
0
 /// <summary>
 /// Refresh the Game data
 /// </summary>
 public void updateGameboard()
 {
     gridGame.Adapter            = null;
     objCell                     = new deviget_minesweeper.ClassAdapters.CustomCellAdapter(GameData.ListCells, (AppCompatActivity)this);
     objCell.actionMenuSelected += ObjCell_actionMenuSelected;
     gridGame.Adapter            = objCell;
     objCell.NotifyDataSetChanged();
 }
示例#2
0
        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();
        }