Allow booleanization of all types
We now allow booleanization of all types. This means that empty versions
of all types now evaluate to false. So a Vector2(0,0), Dictionary(),
etc.
This allows you to write GDScript like:
if not Dictionary():
print("Empty dict")
Booleanization can now also no longer fail. There is no more valid flag,
this changes Variant and GDNative API.
This commit is contained in:
@ -390,7 +390,7 @@ public:
|
||||
uint32_t hash() const;
|
||||
|
||||
bool hash_compare(const Variant &p_variant) const;
|
||||
bool booleanize(bool &valid) const;
|
||||
bool booleanize() const;
|
||||
|
||||
void static_assign(const Variant &p_variant);
|
||||
static void get_constructor_list(Variant::Type p_type, List<MethodInfo> *p_list);
|
||||
|
||||
Reference in New Issue
Block a user