|
@@ -59,6 +59,14 @@ public:
|
|
|
_FORCE_INLINE_ TypedDictionary() {
|
|
|
set_typed(Variant::OBJECT, K::get_class_static(), Variant(), Variant::OBJECT, V::get_class_static(), Variant());
|
|
|
}
|
|
|
+
|
|
|
+ _FORCE_INLINE_ TypedDictionary(std::initializer_list<KeyValue<K, V>> p_init) :
|
|
|
+ Dictionary() {
|
|
|
+ set_typed(Variant::OBJECT, K::get_class_static(), Variant(), Variant::OBJECT, V::get_class_static(), Variant());
|
|
|
+ for (const KeyValue<K, V> &E : p_init) {
|
|
|
+ operator[](E.key) = E.value;
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
template <typename K, typename V>
|
|
@@ -135,6 +143,13 @@ struct GetTypeInfo<const TypedDictionary<K, V> &> {
|
|
|
_FORCE_INLINE_ TypedDictionary() { \
|
|
|
set_typed(Variant::OBJECT, T::get_class_static(), Variant(), m_variant_type, StringName(), Variant()); \
|
|
|
} \
|
|
|
+ _FORCE_INLINE_ TypedDictionary(std::initializer_list<KeyValue<T, m_type>> p_init) : \
|
|
|
+ Dictionary() { \
|
|
|
+ set_typed(Variant::OBJECT, T::get_class_static(), Variant(), m_variant_type, StringName(), Variant()); \
|
|
|
+ for (const KeyValue<T, m_type> &E : p_init) { \
|
|
|
+ operator[](E.key) = E.value; \
|
|
|
+ } \
|
|
|
+ } \
|
|
|
}; \
|
|
|
template <typename T> \
|
|
|
struct GetTypeInfo<TypedDictionary<T, m_type>> { \
|
|
@@ -217,6 +232,13 @@ struct GetTypeInfo<const TypedDictionary<K, V> &> {
|
|
|
_FORCE_INLINE_ TypedDictionary() { \
|
|
|
set_typed(m_variant_type_key, StringName(), Variant(), m_variant_type_value, StringName(), Variant()); \
|
|
|
} \
|
|
|
+ _FORCE_INLINE_ TypedDictionary(std::initializer_list<KeyValue<m_type_key, m_type_value>> p_init) : \
|
|
|
+ Dictionary() { \
|
|
|
+ set_typed(m_variant_type_key, StringName(), Variant(), m_variant_type_value, StringName(), Variant()); \
|
|
|
+ for (const KeyValue<m_type_key, m_type_value> &E : p_init) { \
|
|
|
+ operator[](E.key) = E.value; \
|
|
|
+ } \
|
|
|
+ } \
|
|
|
}; \
|
|
|
template <> \
|
|
|
struct GetTypeInfo<TypedDictionary<m_type_key, m_type_value>> { \
|