Example #1
0
        private void CheckWinning()
        {
            var alert = new UIAlertView ();
            alert.AddButton ("Restart");
            alert.Clicked += delegate {
                _tileGrid = new TileGrid (row, col, mineCount);
                CollectionView.ReloadData();
                _headerView.TileGrid = _tileGrid;
                _headerView.Update();
            };

            if (_tileGrid.PlayerRed > mineCount /2 )
            {
                alert.Title = "Red Won!!!";
                alert.Show ();;
            }

            if (_tileGrid.PlayerBlue > mineCount /2)
            {
                alert.Title = "Blue Won!!!";
                alert.Show ();
            }

            if (_tileGrid.PlayerBlue == _tileGrid.PlayerRed && _tileGrid.PlayerRed + _tileGrid.PlayerBlue == mineCount )
            {
                alert.Title = "Tie!!!";
                alert.Show ();
            }
        }
Example #2
0
 public GameGridView(UICollectionViewLayout layout)
     : base(layout)
 {
     _tileGrid = new TileGrid (row, col, mineCount);
 }