summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/example.cpp6
-rw-r--r--test/src/example.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 8a761a4..4a1f83e 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -153,6 +153,8 @@ void Example::_bind_methods() {
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);
+ ClassDB::bind_method(D_METHOD("test_variant_call", "variant"), &Example::test_variant_call);
+
ClassDB::bind_method(D_METHOD("test_bitfield", "flags"), &Example::test_bitfield);
ClassDB::bind_method(D_METHOD("test_rpc", "value"), &Example::test_rpc);
@@ -402,6 +404,10 @@ void Example::test_set_tileset(TileMap *p_tilemap, const Ref<TileSet> &p_tileset
p_tilemap->set_tileset(p_tileset);
}
+Variant Example::test_variant_call(Variant p_variant) {
+ return p_variant.call("test", "hello");
+}
+
BitField<Example::Flags> Example::test_bitfield(BitField<Flags> flags) {
return flags;
}
diff --git a/test/src/example.h b/test/src/example.h
index 6e00b7f..f847ecc 100644
--- a/test/src/example.h
+++ b/test/src/example.h
@@ -21,6 +21,7 @@
#include <godot_cpp/classes/tile_map.hpp>
#include <godot_cpp/classes/tile_set.hpp>
#include <godot_cpp/classes/viewport.hpp>
+#include <godot_cpp/variant/variant.hpp>
#include <godot_cpp/core/binder_common.hpp>
@@ -134,6 +135,8 @@ public:
void test_add_child(Node *p_node);
void test_set_tileset(TileMap *p_tilemap, const Ref<TileSet> &p_tileset) const;
+ Variant test_variant_call(Variant p_variant);
+
BitField<Flags> test_bitfield(BitField<Flags> flags);
// RPC