Add documentation as to why the query is not changing to 1:n for RequireKeyValueTags

This commit is contained in:
Lothsahn 2023-08-14 01:51:32 -04:00
parent 8afce3665f
commit 67c6eb310c

View File

@ -191,6 +191,11 @@ public QueryType WithTag( string tag )
public QueryType AddRequiredKeyValueTag(string key, string value)
{
// While KeyValueTags are typically a 1:many relationship, calling AddRequiredKeyValueTag more than once in a
// query with the same key results in erasing the previous required value for the same key. For this reason,
// someone who calls this method twice in a row with the same key is probably not getting the behavior they
// expect. Therefore, leaving this a dictionary to cause a key conflict if someone adds multiple required values
// for the same key in the same query.
if (requiredKv == null) requiredKv = new Dictionary<string, string>();
requiredKv.Add(key, value);
return this;
@ -317,4 +322,4 @@ private void ApplyReturns(UGCQueryHandle_t handle)
#endregion
}
}
}