public void RepoFromScratch()
        {
            var repo            = new TileSetRepo.TileSetRepo();
            var repo_string_0ts = repo.Serialize();

            var tsr1 = ProceduralHSVTileSet.Default();

            tsr1.packname = "unique1";
            var tsr2 = ProceduralHSVTileSet.Default();

            tsr2.packname = "unique2";

            repo.AddTileSet(tsr1);
            repo.AddTileSet(tsr2);

            var repo_string_2ts = repo.Serialize();

            var repo0 = TileSetRepo.TileSetRepo.DeSerialize(repo_string_0ts);
            var repo2 = TileSetRepo.TileSetRepo.DeSerialize(repo_string_2ts);

            // System.Console.WriteLine(String.Format("Repo0 serialization {0}", repo_string_0ts));
            // System.Console.WriteLine(String.Format("Repo2 serialization {0}", repo_string_2ts));

            Assert.AreEqual(0, repo0.NumberOfTilesets());
            Assert.AreEqual(2, repo2.NumberOfTilesets());
            StringAssert.Contains("unique1", repo_string_2ts);
        }
Ejemplo n.º 2
0
        public void TileSetTypeSerialization()
        {
            var phsv1 = ProceduralHSVTileSet.Default();
            var bmts2 = ChoppedBitmapTileSet.Default();

            Assert.AreEqual("ProceduralHSVTileSet", TileSet.DetermineType(phsv1.Serialize()));
            Assert.AreEqual("ChoppedBitmapTileSet", TileSet.DetermineType(bmts2.Serialize()));
        }