Ejemplo n.º 1
0
        public void TestParseMapObjectData(string mapObjectDataFilePath)
        {
            using var original  = FileProvider.GetFile(mapObjectDataFilePath);
            using var recreated = new MemoryStream();

            MapObjectData.Parse(original, true).SerializeTo(recreated, true);
            StreamAssert.AreEqual(original, recreated, true);
        }
Ejemplo n.º 2
0
        public void TestCreateNewObjectData()
        {
            var objectData = new MapObjectData(
                new MapUnitObjectData(Array.Empty <ObjectModification>()),
                new MapItemObjectData(Array.Empty <ObjectModification>()),
                new MapDestructableObjectData(Array.Empty <ObjectModification>()),
                new MapDoodadObjectData(Array.Empty <ObjectModification>()),
                new MapAbilityObjectData(Array.Empty <ObjectModification>()),
                new MapBuffObjectData(Array.Empty <ObjectModification>()),
                new MapUpgradeObjectData(Array.Empty <ObjectModification>()));

            using var memoryStream = new MemoryStream();
            objectData.SerializeTo(memoryStream, true);

            memoryStream.Position = 0;
            MapObjectData.Parse(memoryStream);
        }