Removed TagType.EMPTY

This commit is contained in:
glax 2023-04-01 01:32:15 +02:00
parent 9dc282253d
commit 452c5d3177

View File

@ -120,8 +120,9 @@ public class RegionConverter
currentTags.TryAdd(Tag.TagType.id, Convert.ToUInt64(wayReader.GetAttribute("id")!));
if (wayReader.Name == "tag")
{
Tag wayTag = Tag.ConvertToTag(wayReader.GetAttribute("k")!, wayReader.GetAttribute("v")!);
currentTags.TryAdd(wayTag.key, wayTag.value);
Tag? wayTag = Tag.ConvertToTag(wayReader.GetAttribute("k")!, wayReader.GetAttribute("v")!);
if(wayTag is not null)
currentTags.TryAdd(wayTag.key, wayTag.value);
}
else if (wayReader.Name == "nd")
{
@ -193,8 +194,13 @@ public class RegionConverter
string tagsRegionPath = Path.Combine(outputPath, regionHash.ToString(), tagsFileName);
regionTagsFileStreams.Add(regionHash, new FileStream(tagsRegionPath, FileMode.OpenOrCreate));
}
ulong id = currentTags[Tag.TagType.id];
TagManager tm = new TagManager();
foreach(KeyValuePair<Tag.TagType, dynamic> kv in currentTags)
tm.AddTag(id, kv);
#pragma warning disable SYSLIB0011
bFormatter.Serialize(regionTagsFileStreams[regionHash], currentTags);
bFormatter.Serialize(regionTagsFileStreams[regionHash], tm);
#pragma warning restore SYSLIB0011
}
}