#ifndef UTILS_FUNCTIONS_HPP #define UTILS_FUNCTIONS_HPP #include #include namespace utils { template godot::Dictionary hashmap_to_dictionary(godot::HashMap const &map) { godot::Dictionary dict{}; for(godot::KeyValue const &kvp : map) dict[kvp.key] = kvp.value; return dict; } template godot::HashMap dictionary_to_hashmap(godot::Dictionary const &dict) { godot::HashMap map{}; godot::Array keys{dict.keys()}; for(size_t i = 0; i < keys.size(); ++i) map.insert(keys[i], dict[keys[i]]); return map; } } #endif // !UTILS_FUNCTIONS_HPP