diff --git a/BeefySysLib/util/MultiDictionary.h b/BeefySysLib/util/MultiDictionary.h index 52d12172..2d197225 100644 --- a/BeefySysLib/util/MultiDictionary.h +++ b/BeefySysLib/util/MultiDictionary.h @@ -117,12 +117,12 @@ public: return *this; // At end } - TKey GetKey() + TKey& GetKey() { return this->mDict->mEntries[this->mCurEntry].mKey; } - TValue GetValue() + TValue& GetValue() { return this->mDict->mEntries[this->mCurEntry].mValue; } @@ -466,6 +466,21 @@ public: } return end(); + } + + template + bool Contains(const TKey& key) + { + return TryGet(key) != end(); + } + + template + int GetCount(const TKey& key) + { + int count = 0; + for (auto itr = TryGet(key); itr != end(); ++itr) + count++; + return count; } template