dictionary has_all

This commit is contained in:
Alexander Holland
2016-04-04 18:37:43 +02:00
parent 9c89d3e042
commit a8ebd43ab7
3 changed files with 14 additions and 0 deletions

View File

@ -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);