namespace OSMServer; public class Connection { public Coordinates end { get; } private Dictionary tags; public Connection(Coordinates end) { this.end = end; this.tags = new Dictionary(); } public Connection(Coordinates end, Dictionary tags) { this.end = end; this.tags = tags; } public bool AddTag(string key, string value) { return this.tags.TryAdd(key, value); } public string? TryGetTagValue(string key) { return this.tags.ContainsKey(key) ? this.tags[key] : null; } public bool ContainsTag(string key) { return this.tags.ContainsKey(key); } public void UpdateTag(string key, string value) { if(!this.AddTag(key, value)) this.tags[key] = value; } }