public sealed override void Smooth() { Func <Tile, bool> condition = (currentTile) => currentTile.Type == Tile.TileType.WATER; Tile replacement = new Tile() { Type = Tile.TileType.WATER, Icon = Tile.TileType.DEFAULT }; CornerSmoother.Smooth(tile, condition, false, replacement); condition = (currentTile) => currentTile.Icon == Tile.TileType.FOREST; Tile[] replacements = { new Tile() { Type = Tile.TileType.GRASS, Icon = Tile.TileType.PINE }, new Tile() { Type = Tile.TileType.GRASS, Icon = Tile.TileType.TREE }, new Tile() { Type = Tile.TileType.GRASS, Icon = Tile.TileType.DEFAULT } }; CornerSmoother.Smooth(tile, condition, true, replacements); }
public sealed override void Smooth() { Func <Tile, bool> condition = (currentTile) => currentTile.Type == Tile.TileType.WATER; Tile replacement = new Tile() { Type = Tile.TileType.WATER, Icon = Tile.TileType.DEFAULT }; CornerSmoother.Smooth(tile, condition, false, replacement); if (tile.Orientation == Map.Orientation.Top) { land[LAND_WIDTH - 1, LAND_HEIGHT - 2].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 1, LAND_HEIGHT - 3].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 2, LAND_HEIGHT - 3].Icon = Tile.TileType.DEFAULT; land[0, LAND_HEIGHT - 2].Icon = Tile.TileType.DEFAULT; land[0, LAND_HEIGHT - 3].Icon = Tile.TileType.DEFAULT; land[1, LAND_HEIGHT - 3].Icon = Tile.TileType.DEFAULT; } else if (tile.Orientation == Map.Orientation.Bottom) { land[LAND_WIDTH - 1, 1].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 1, 2].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 2, 2].Icon = Tile.TileType.DEFAULT; land[0, 1].Icon = Tile.TileType.DEFAULT; land[0, 2].Icon = Tile.TileType.DEFAULT; land[1, 2].Icon = Tile.TileType.DEFAULT; } else if (tile.Orientation == Map.Orientation.Left) { land[1, LAND_HEIGHT - 1].Icon = Tile.TileType.DEFAULT; land[2, LAND_HEIGHT - 1].Icon = Tile.TileType.DEFAULT; land[2, LAND_HEIGHT - 2].Icon = Tile.TileType.DEFAULT; land[1, 0].Icon = Tile.TileType.DEFAULT; land[2, 0].Icon = Tile.TileType.DEFAULT; land[2, 1].Icon = Tile.TileType.DEFAULT; } else if (tile.Orientation == Map.Orientation.Right) { land[LAND_WIDTH - 2, LAND_HEIGHT - 1].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 3, LAND_HEIGHT - 1].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 3, LAND_HEIGHT - 2].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 2, 0].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 3, 0].Icon = Tile.TileType.DEFAULT; land[LAND_WIDTH - 3, 1].Icon = Tile.TileType.DEFAULT; } }
public sealed override void Smooth() { Func <Tile, bool> condition = (currentTile) => currentTile.Type == Tile.TileType.PLAIN && ( currentTile.Icon == Tile.TileType.FOREST || currentTile.Icon == Tile.TileType.MOUNTAIN || currentTile.Icon == Tile.TileType.DEFAULT); Tile replacement = new Tile() { Type = Tile.TileType.GRASS, Icon = Tile.TileType.DEFAULT }; CornerSmoother.Smooth(tile, condition, false, replacement); }