Hey all,
I am considering using GDNative to help with performance issues with part of my code. However, I am handling some pretty complex data structures, and I'm wondering how feasible it will be for me to use a low level language like C or possibly Rust to work with those structures.
It would be difficult for me to go into detail on what exactly I'm doing, but a minimal example would be the following. Let's assume I have a script called data.gd
with the following code:
var foo = 6
var bar = "baz"
And then I have another script called structure.gd
with the following code:
var data_preload = preload("res://data.gd")
var data_list = []
for i in range(0, 20):
var tmp = data_preload.new()
tmp.foo = i
data_list.append(tmp)
(I am aware that class_name
is now a syntax. However, if possible, I'd like to accomplish this with the current preload()
syntax.)
Now I want to make a GDNative module that might, for example, have a function that takes an instance of structure.gd
as an argument, loops through data_list
and sums up all of the foo
s, and then return the sum. What type should I give to the argument, what type should I give to the return type, and how should I access the properties of structure.gd
or data.gd
?
Any help is appreciated.