2017-03-04 02:04:16 +00:00
|
|
|
#ifndef DICTIONARY_H
|
|
|
|
#define DICTIONARY_H
|
|
|
|
|
2017-03-06 07:49:24 +00:00
|
|
|
#include "Variant.hpp"
|
2017-03-04 02:04:16 +00:00
|
|
|
|
2017-03-06 07:49:24 +00:00
|
|
|
#include "Array.hpp"
|
2017-03-04 02:04:16 +00:00
|
|
|
|
2017-10-03 10:37:34 +00:00
|
|
|
#include <gdnative/dictionary.h>
|
2017-03-04 02:04:16 +00:00
|
|
|
|
|
|
|
namespace godot {
|
|
|
|
|
2017-07-23 15:53:50 +00:00
|
|
|
class Dictionary {
|
2017-03-04 02:04:16 +00:00
|
|
|
godot_dictionary _godot_dictionary;
|
2018-11-23 22:09:41 +00:00
|
|
|
|
2017-03-04 02:04:16 +00:00
|
|
|
public:
|
2017-03-06 02:30:46 +00:00
|
|
|
Dictionary();
|
2018-11-23 22:09:41 +00:00
|
|
|
Dictionary(const Dictionary &other);
|
|
|
|
Dictionary &operator=(const Dictionary &other);
|
2017-03-06 02:30:46 +00:00
|
|
|
|
2018-03-07 10:27:34 +00:00
|
|
|
template <class... Args>
|
|
|
|
static Dictionary make(Args... args) {
|
|
|
|
return helpers::add_all(Dictionary(), args...);
|
|
|
|
}
|
|
|
|
|
2017-03-06 02:30:46 +00:00
|
|
|
void clear();
|
|
|
|
|
|
|
|
bool empty() const;
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
void erase(const Variant &key);
|
2017-03-06 02:30:46 +00:00
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
bool has(const Variant &key) const;
|
2017-03-06 02:30:46 +00:00
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
bool has_all(const Array &keys) const;
|
2017-03-06 02:30:46 +00:00
|
|
|
|
|
|
|
uint32_t hash() const;
|
|
|
|
|
|
|
|
Array keys() const;
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
Variant &operator[](const Variant &key);
|
2017-03-06 02:30:46 +00:00
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
const Variant &operator[](const Variant &key) const;
|
2017-03-06 02:30:46 +00:00
|
|
|
|
|
|
|
int size() const;
|
|
|
|
|
|
|
|
String to_json() const;
|
|
|
|
|
|
|
|
Array values() const;
|
|
|
|
|
|
|
|
~Dictionary();
|
2017-03-04 02:04:16 +00:00
|
|
|
};
|
|
|
|
|
2018-11-23 22:09:41 +00:00
|
|
|
} // namespace godot
|
2017-03-04 02:04:16 +00:00
|
|
|
|
|
|
|
#endif // DICTIONARY_H
|