Exemple #1
0
        private void MakeTiles(string name, Bitmap image)
        {
            var tilePathProvider = new DefaultTilePathProvider
            {
                ParentDirectory = @"C:\Users\jfoshee\Documents\visual studio 2010\Projects\BluwareDemo\BluwareDemo\ImageCache",
                Name            = name
            };
            var tileWriter = new TileWriter {
                TilePathProvider = tilePathProvider
            };
            var tileCount = tileWriter.Write(image, 64, 64);

            Console.WriteLine("Tile count: " + tileCount);
        }
        private static void Write(string name, IReadOnlyCollection <Tile> tiles)
        {
            var before = tiles.Count;

            var unique = tiles.DistinctBy(t => t.Name)
                         .ToHashSet();

            var after = unique.Count;

            if (before != after)
            {
                Error($"Found {before - after} duplicate tiles.");
            }

            var writer = new TileWriter(new TdpOptions(name), unique);

            writer.WriteTileSet();
        }