How to port C# class with IEnumerator to GDScript?

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

I would like to port my few simple C# classes to GDScript. Full code here:

Main idea of classes is simple:
Base class:

  • public abstract class FSObject - contains Name, ParentDirectory, FullName and IsDirectory properties.
    2 derived classes:
  • public class File : FSObject - have additional properties like Size, IsCompressed, CompressedSize.
  • public class Directory : FSObject, IEnumerable - has functions AddObject, DeleteObject and IEnumerator

How I can write this on GDScript? Main problem is IEnumerator. Is there something similar?

:bust_in_silhouette: Reply From: q4a

Discord user bojidar-bg point me to docs. So looks there is not a big problem.