Added way to add Tags from KeyValuePair

This commit is contained in:
glax 2023-03-31 21:54:01 +02:00
parent 090981fb99
commit 6a2ddf3277

View File

@ -33,6 +33,13 @@ public class TagManager
}
}
public void AddTag(ulong wayId, KeyValuePair<Tag.TagType, dynamic> keyValuePair)
{
if(!wayTags.ContainsKey(wayId))
wayTags.Add(wayId, new HashSet<Tag>());
wayTags[wayId].Add(new Tag(keyValuePair.Key, keyValuePair.Value));
}
public HashSet<Tag>? GetTagsForWayId(ulong wayId)
{
return wayTags.TryGetValue(wayId, out HashSet<Tag>? value) ? value : null;