Closed rcorre closed 9 months ago
Fixes #38.
Given:
message Foo { repeated int32 i = 1; repeated string s = 2; repeated Bar b = 3; }
Previously godobuf would generate:
get_i() -> Array get_s() -> Array get_b() -> Array
Now it generates:
get_i() -> Array[int] get_s() -> Array[string] get_b() -> Array[Bar]
To do this, we must assign a typed array when constructing the PBField. Godot does not currently have a typed array constructor: https://github.com/godotengine/godot/issues/72627#issuecomment-1414516463 To work around this, we create a local typed variable, like so:
class Test1: func _init(): var __rf_double_default: Array[float] = [] __rf_double = PBField.new("rf_double", PB_DATA_TYPE.DOUBLE, PB_RULE.REPEATED, 23, true, __rf_double_default) ... func get_rf_double() -> Array[float]: return __rf_double.value
Based on #37
Fixes #38.
Given:
Previously godobuf would generate:
Now it generates:
To do this, we must assign a typed array when constructing the PBField. Godot does not currently have a typed array constructor: https://github.com/godotengine/godot/issues/72627#issuecomment-1414516463 To work around this, we create a local typed variable, like so: