Why is there not `set` type in GDScript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Evan Rose

There’s support for Array and List, but no Set.

If I want to use a Set in GDScript, do I have to implement my own?

Edit: I plan on using a dictionary where I just point to null. Could wrap this with a Set class I guess.

IMHO a Dictionary could serve well as set. You can add items, check if it contains items and remove them again. If that isn’t sufficient then I propose you provide an example or more details in any way.

wombatstampede | 2019-04-28 12:28

No, you’re right. And i did implement my logic in this way. It just makes the code really ugly.

Evan Rose | 2019-04-28 15:18