0 votes

Is there a typed version of Dictionary and Array in GDNative? For example I want to store some structs in a map, or just have better auto complete when it is known what the map/array will store.

in Engine by (21 points)

2 Answers

+1 vote
Best answer

GDNative doesn't provide strongly typed versions for Dictionary and Array. An option is to use std::map/unordered_map/vector for those use cases, as long as you don't need to feed the containers to Godot.

by (21 points)
0 votes

I haven't seen a typed version of Dictionary as part of Godot's code/APIs.

Developers working with C# can make use of the System.Collections.Generic types that are part of .NET Framework.
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2?view=netframework-4.8

by (854 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories