mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-10 21:09:38 +01:00
Added more getters to the new HshMap, for more backwards compatibility.
This commit is contained in:
parent
fd7c2153a6
commit
3c461a4660
@ -63,6 +63,26 @@ public:
|
|||||||
Element *next = nullptr;
|
Element *next = nullptr;
|
||||||
Element *prev = nullptr;
|
Element *prev = nullptr;
|
||||||
KeyValue<TKey, TValue> data;
|
KeyValue<TKey, TValue> 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() {}
|
||||||
Element(const TKey &p_key, const TValue &p_value) :
|
Element(const TKey &p_key, const TValue &p_value) :
|
||||||
data(p_key, p_value) {}
|
data(p_key, p_value) {}
|
||||||
@ -154,6 +174,14 @@ public:
|
|||||||
return NULL;
|
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.
|
* 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==()
|
* This version is custom, will take a hash and a custom key (that should support operator==()
|
||||||
|
Loading…
Reference in New Issue
Block a user