private void AddRandomTile() { if (BinaryGrid.AvailablePositionCount() > 0) { int value = (RandomManager.NextDouble() < 0.9) ? 2 : 4; var tile = BinaryGrid.InsertTile(BinaryGrid.RandomAvailablePosition(), value); RaiseTileAdded(tile); } }
public void RestoreTile(TileData tile, GameDefinition gameDefinition) { if (tile == null) { return; } tile.GameDefinition = gameDefinition; BinaryGrid.InsertTile(tile); RaiseTileAdded(tile); }