dictionary has_all
This commit is contained in:
parent
9c89d3e042
commit
a8ebd43ab7
3 changed files with 14 additions and 0 deletions
|
|
@ -110,6 +110,16 @@ bool Dictionary::has(const Variant& p_key) const {
|
|||
|
||||
return _p->variant_map.has(p_key);
|
||||
}
|
||||
|
||||
bool Dictionary::has_all(const Array& p_keys) const {
|
||||
for (int i=0;i<p_keys.size();i++) {
|
||||
if( !has(p_keys[i]) ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Dictionary::erase(const Variant& p_key) {
|
||||
_copy_on_write();
|
||||
_p->variant_map.erase(p_key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue