From UE 5.4 onwards, you have to inherit from uint8 since, otherwise, it will throw a compiler warning. Also, before UE 5.4, creating enums without uint8 would add them to the global namespace, which can lead to issues.
I have briefly looked up fields for enums in Java. Correct me if I'm wrong but they seem to be a way to store additional information to an enum entry, right? To some extent, you can add meta information to an enum entry by using the UMETA() macro which can only be used for editor information and not game logic. So it seems that fields for enums in Java allow for more complex enums and I'm currently not aware of a way to replicate this behavior 1 to 1 for Unreal Engine Enums.
@@PobatoTutorials Yes, enums allow storing additional info. I suppose I could use DataTables for this, to make records mutable not from code. In fact, there are a lot of things I want to drag from Java/Kotlin to C++, such as safe calls, stream api that allows working with collections via chained calls. Ehh, but it is not clear yet why this is not yet in Unreal Engine/C++. Perhaps it is an optimization issue.
Why should I inherit enum from uint8?
Can I add more fields like in a Java?
From UE 5.4 onwards, you have to inherit from uint8 since, otherwise, it will throw a compiler warning.
Also, before UE 5.4, creating enums without uint8 would add them to the global namespace, which can lead to issues.
@@PobatoTutorials Thank you
I have briefly looked up fields for enums in Java.
Correct me if I'm wrong but they seem to be a way to store additional information to an enum entry, right?
To some extent, you can add meta information to an enum entry by using the UMETA() macro which can only be used for editor information and not game logic.
So it seems that fields for enums in Java allow for more complex enums and I'm currently not aware of a way to replicate this behavior 1 to 1 for Unreal Engine Enums.
@@PobatoTutorials Yes, enums allow storing additional info. I suppose I could use DataTables for this, to make records mutable not from code. In fact, there are a lot of things I want to drag from Java/Kotlin to C++, such as safe calls, stream api that allows working with collections via chained calls. Ehh, but it is not clear yet why this is not yet in Unreal Engine/C++. Perhaps it is an optimization issue.