summaryrefslogtreecommitdiff
path: root/scene/resources/scene_replication_config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/scene_replication_config.cpp')
-rw-r--r--scene/resources/scene_replication_config.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/resources/scene_replication_config.cpp b/scene/resources/scene_replication_config.cpp
index 2acc0f1922..4aea04bf87 100644
--- a/scene/resources/scene_replication_config.cpp
+++ b/scene/resources/scene_replication_config.cpp
@@ -124,6 +124,15 @@ void SceneReplicationConfig::remove_property(const NodePath &p_path) {
properties.erase(p_path);
}
+bool SceneReplicationConfig::has_property(const NodePath &p_path) const {
+ for (int i = 0; i < properties.size(); i++) {
+ if (properties[i].name == p_path) {
+ return true;
+ }
+ }
+ return false;
+}
+
int SceneReplicationConfig::property_get_index(const NodePath &p_path) const {
for (int i = 0; i < properties.size(); i++) {
if (properties[i].name == p_path) {
@@ -178,6 +187,7 @@ void SceneReplicationConfig::property_set_sync(const NodePath &p_path, bool p_en
void SceneReplicationConfig::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_properties"), &SceneReplicationConfig::get_properties);
ClassDB::bind_method(D_METHOD("add_property", "path", "index"), &SceneReplicationConfig::add_property, DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("has_property", "path"), &SceneReplicationConfig::has_property);
ClassDB::bind_method(D_METHOD("remove_property", "path"), &SceneReplicationConfig::remove_property);
ClassDB::bind_method(D_METHOD("property_get_index", "path"), &SceneReplicationConfig::property_get_index);
ClassDB::bind_method(D_METHOD("property_get_spawn", "path"), &SceneReplicationConfig::property_get_spawn);