summaryrefslogtreecommitdiffstats
path: root/test/src/example.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/example.cpp')
-rw-r--r--test/src/example.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 692d004..22739b2 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -217,6 +217,7 @@ void Example::_bind_methods() {
ClassDB::bind_method(D_METHOD("test_variant_vector2i_conversion", "variant"), &Example::test_variant_vector2i_conversion);
ClassDB::bind_method(D_METHOD("test_variant_int_conversion", "variant"), &Example::test_variant_int_conversion);
ClassDB::bind_method(D_METHOD("test_variant_float_conversion", "variant"), &Example::test_variant_float_conversion);
+ ClassDB::bind_method(D_METHOD("test_object_is_valid", "variant"), &Example::test_object_is_valid);
ClassDB::bind_method(D_METHOD("test_add_child", "node"), &Example::test_add_child);
ClassDB::bind_method(D_METHOD("test_set_tileset", "tilemap", "tileset"), &Example::test_set_tileset);
@@ -598,6 +599,10 @@ float Example::test_variant_float_conversion(const Variant &p_variant) const {
return p_variant;
}
+bool Example::test_object_is_valid(const Variant &p_variant) const {
+ return static_cast<bool>(p_variant.get_validated_object());
+}
+
void Example::test_add_child(Node *p_node) {
add_child(p_node);
}
@@ -755,3 +760,11 @@ ExampleRuntime::ExampleRuntime() {
ExampleRuntime::~ExampleRuntime() {
}
+
+void ExamplePrzykład::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("get_the_word"), &ExamplePrzykład::get_the_word);
+}
+
+String ExamplePrzykład::get_the_word() const {
+ return U"słowo to przykład";
+}