summaryrefslogtreecommitdiffstats
path: root/include/core/RID.hpp
blob: 2191bbf7e3b60d6e0c2eb17d535607438b06d9aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef RID_H
#define RID_H

#include <gdnative/rid.h>

namespace godot {

class Object;

class RID {
	godot_rid _godot_rid;

public:
	RID();

	RID(Object *p);

	godot_rid _get_godot_rid() const;

	int32_t get_id() 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;
};

} // namespace godot

#endif // RID_H