summaryrefslogtreecommitdiffstats
path: root/core/dictionary.cpp
diff options
context:
space:
mode:
authorAlexander Holland <alexander.holland@live.de>2016-04-04 18:37:43 +0200
committerAlexander Holland <alexander.holland@live.de>2016-04-04 18:37:43 +0200
commita8ebd43ab7d246669f1a8bb30fb780c07abe01d6 (patch)
treef28557ff0fe1abf7ee09044d9b083186fcf1db30 /core/dictionary.cpp
parent9c89d3e042fd7a6472ac2261afedaa235d2b4ebb (diff)
downloadredot-engine-a8ebd43ab7d246669f1a8bb30fb780c07abe01d6.tar.gz
dictionary has_all
Diffstat (limited to 'core/dictionary.cpp')
-rw-r--r--core/dictionary.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index a013c21b29..75c8531251 100644
--- a/core/dictionary.cpp
+++ b/core/dictionary.cpp
@@ -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);