diff --git a/core/containers/hash_map.h b/core/containers/hash_map.h index 98bcd2d1f..692991e76 100644 --- a/core/containers/hash_map.h +++ b/core/containers/hash_map.h @@ -63,6 +63,26 @@ public: Element *next = nullptr; Element *prev = nullptr; KeyValue data; + + const TKey &key() const { + return data.key; + } + + TValue &value() { + return data.value; + } + + const TValue &value() const { + return data.value; + } + + TValue &get() { + return data.value; + }; + const TValue &get() const { + return data.value; + }; + Element() {} Element(const TKey &p_key, const TValue &p_value) : data(p_key, p_value) {} @@ -154,6 +174,14 @@ public: return NULL; } + _FORCE_INLINE_ const Element *find(const TKey &p_key) const { + return get_element(p_key); + } + + _FORCE_INLINE_ Element *find(const TKey &p_key) { + return get_element(p_key); + } + /** * Same as get, except it can return NULL when item was not found. * This version is custom, will take a hash and a custom key (that should support operator==()