Exemple #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);
            }
        }
Exemple #2
0
        public void RestoreTile(TileData tile, GameDefinition gameDefinition)
        {
            if (tile == null)
            {
                return;
            }

            tile.GameDefinition = gameDefinition;
            BinaryGrid.InsertTile(tile);
            RaiseTileAdded(tile);
        }