Esempio n. 1
0
        private void AddRandomTile()
        {
            if (BinaryGrid.AvailablePositionCount() > 0)
            {
                int value = (RandomManager.NextDouble() < 0.9) ? 2 : 4;
                var tile  = BinaryGrid.InsertTile(BinaryGrid.RandomAvailablePosition(), value);

                RaiseTileAdded(tile);
            }
        }
Esempio n. 2
0
 private bool MovesAvailable()
 {
     if (BinaryGrid.AvailablePositionCount() > 0)
     {
         return(true);
     }
     if (TileMatchesAvailable())
     {
         return(true);
     }
     return(false);
 }