Add has_prop() to the library's api.

This commit is contained in:
Relintai 2020-07-20 21:21:28 +02:00
parent f8663879dd
commit a0f01044a1
2 changed files with 5 additions and 0 deletions

View File

@ -213,6 +213,9 @@ Ref<PropData> VoxelmanLibrary::get_prop(const int id) {
} }
void VoxelmanLibrary::add_prop(Ref<PropData> value) { void VoxelmanLibrary::add_prop(Ref<PropData> value) {
} }
bool VoxelmanLibrary::has_prop(const Ref<PropData> &value) const {
return false;
}
void VoxelmanLibrary::set_prop(int id, Ref<PropData> value) { void VoxelmanLibrary::set_prop(int id, Ref<PropData> value) {
} }
void VoxelmanLibrary::remove_prop(const int id) { void VoxelmanLibrary::remove_prop(const int id) {
@ -298,6 +301,7 @@ void VoxelmanLibrary::_bind_methods() {
#ifdef PROPS_PRESENT #ifdef PROPS_PRESENT
ClassDB::bind_method(D_METHOD("get_prop", "id"), &VoxelmanLibrary::get_prop); ClassDB::bind_method(D_METHOD("get_prop", "id"), &VoxelmanLibrary::get_prop);
ClassDB::bind_method(D_METHOD("add_prop", "value"), &VoxelmanLibrary::add_prop); ClassDB::bind_method(D_METHOD("add_prop", "value"), &VoxelmanLibrary::add_prop);
ClassDB::bind_method(D_METHOD("has_prop", "prop"), &VoxelmanLibrary::has_prop);
ClassDB::bind_method(D_METHOD("set_prop", "id", "surface"), &VoxelmanLibrary::set_prop); ClassDB::bind_method(D_METHOD("set_prop", "id", "surface"), &VoxelmanLibrary::set_prop);
ClassDB::bind_method(D_METHOD("remove_prop", "id"), &VoxelmanLibrary::remove_prop); ClassDB::bind_method(D_METHOD("remove_prop", "id"), &VoxelmanLibrary::remove_prop);
ClassDB::bind_method(D_METHOD("get_num_props"), &VoxelmanLibrary::get_num_props); ClassDB::bind_method(D_METHOD("get_num_props"), &VoxelmanLibrary::get_num_props);

View File

@ -97,6 +97,7 @@ public:
#ifdef PROPS_PRESENT #ifdef PROPS_PRESENT
virtual Ref<PropData> get_prop(const int id); virtual Ref<PropData> get_prop(const int id);
virtual void add_prop(Ref<PropData> value); virtual void add_prop(Ref<PropData> value);
virtual bool has_prop(const Ref<PropData> &value) const;
virtual void set_prop(const int id, Ref<PropData> value); virtual void set_prop(const int id, Ref<PropData> value);
virtual void remove_prop(const int id); virtual void remove_prop(const int id);
virtual int get_num_props() const; virtual int get_num_props() const;