Added RID::is_valid() and comparison operators

- is_valid() is worked around by comparing a default RID()
This commit is contained in:
Marc Gilleron
2018-01-20 19:37:23 +01:00
parent 51f1d3ce5d
commit 06c61b6535
2 changed files with 47 additions and 1 deletions

View File

@@ -11,12 +11,24 @@ class RID {
godot_rid _godot_rid;
public:
inline RID() {}
RID();
RID(Object *p);
int32_t get_rid() const;
inline bool is_valid() const {
// is_valid() is not available in the C API...
return *this == RID();
}
bool operator==(const RID & p_other) const;
bool operator!=(const RID & p_other) const;
bool operator<(const RID & p_other) const;
bool operator>(const RID & p_other) const;
bool operator<=(const RID & p_other) const;
bool operator>=(const RID & p_other) const;
};
}