Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Karol23 |
Hi is there a way how to use anonymous enum as type? I would like to have named class representing only an enum. Like this:
class_name CustomType
enum {
a, b, c
}
and then have functions accepting only the enum like this
func set_type(type: CustomType):
but I am getting error about using anonymous enums as type. Only solution I came with is to name the enum. For example
class_name CustomType
enum em {
a, b, c
}
with functions changed to
func set_type(type: CustomType.em):
set_type(CustomType.em.a)
Which is not super bad, but I would like to ged rid of the em prefix. Is there any way?
Thanks