diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2018-01-20 19:37:23 +0100 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2018-01-20 19:37:23 +0100 |
commit | 06c61b65355e59acfe64ab94515abce77c5724c7 (patch) | |
tree | 6c1ee3292dc433f2f675da3b17952fad925c49b8 /include/core/RID.hpp | |
parent | 51f1d3ce5d4e40522b99115140e560772c77f765 (diff) | |
download | redot-cpp-06c61b65355e59acfe64ab94515abce77c5724c7.tar.gz |
Added RID::is_valid() and comparison operators
- is_valid() is worked around by comparing a default RID()
Diffstat (limited to 'include/core/RID.hpp')
-rw-r--r-- | include/core/RID.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/core/RID.hpp b/include/core/RID.hpp index 3a968bf..71b5140 100644 --- a/include/core/RID.hpp +++ b/include/core/RID.hpp @@ -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; + }; } |