Dictionary.hpp 847 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef DICTIONARY_H
  2. #define DICTIONARY_H
  3. #include "Variant.hpp"
  4. #include "Array.hpp"
  5. #include <gdnative/dictionary.h>
  6. namespace godot {
  7. class Dictionary {
  8. godot_dictionary _godot_dictionary;
  9. public:
  10. Dictionary();
  11. Dictionary(const Dictionary & other);
  12. Dictionary & operator=(const Dictionary & other);
  13. template <class... Args>
  14. static Dictionary make(Args... args) {
  15. return helpers::add_all(Dictionary(), args...);
  16. }
  17. void clear();
  18. bool empty() const;
  19. void erase(const Variant& key);
  20. bool has(const Variant& key) const;
  21. bool has_all(const Array& keys) const;
  22. uint32_t hash() const;
  23. Array keys() const;
  24. Variant &operator [](const Variant& key);
  25. const Variant &operator [](const Variant& key) const;
  26. int size() const;
  27. String to_json() const;
  28. Array values() const;
  29. ~Dictionary();
  30. };
  31. }
  32. #endif // DICTIONARY_H