This is how you can treat a Godot variable like a property in C#, where access to its value is encapsulated in some way:
var foobar: Array = [] :
@export
get:return foobar
set(value):
= value foobar
Note that the syntax here is special so that
accessing foobar
in the example above
actually accesses the underlying value instead of
causing infinite recursion.
Source: docs.godotengine.org