summaryrefslogtreecommitdiffstats
path: root/test/src/example.cpp
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-02-21 07:51:52 -0600
committerGitHub <noreply@github.com>2024-02-21 07:51:52 -0600
commitf90085917b16c3daff7b2d195db9bf222119eea1 (patch)
treedc26c7ec5800a5facbeb71e035bb4748c00b1bbc /test/src/example.cpp
parenta6d939334166602b85ee4d28c0daa1c87c9fba02 (diff)
parentfb884573ea1a0ec36d1968bf12a667cd17023d38 (diff)
downloadredot-cpp-f90085917b16c3daff7b2d195db9bf222119eea1.tar.gz
Merge pull request #1256 from dsnopek/placeholders
Allow registering "runtime classes"
Diffstat (limited to 'test/src/example.cpp')
-rw-r--r--test/src/example.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp
index 53d11f4..136ac94 100644
--- a/test/src/example.cpp
+++ b/test/src/example.cpp
@@ -637,3 +637,23 @@ String Example::test_virtual_implemented_in_script(const String &p_name, int p_v
}
return "Unimplemented";
}
+
+void ExampleRuntime::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_prop_value", "value"), &ExampleRuntime::set_prop_value);
+ ClassDB::bind_method(D_METHOD("get_prop_value"), &ExampleRuntime::get_prop_value);
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "prop_value"), "set_prop_value", "get_prop_value");
+}
+
+void ExampleRuntime::set_prop_value(int p_prop_value) {
+ prop_value = p_prop_value;
+}
+
+int ExampleRuntime::get_prop_value() const {
+ return prop_value;
+}
+
+ExampleRuntime::ExampleRuntime() {
+}
+
+ExampleRuntime::~ExampleRuntime() {
+}