Structs and Enums
Structs
Define named structures using the struct
keyword:
The default value of a struct, is initialized with all its fields set to their default value.
Anonymous Structures
Declare anonymous structures using { identifier1: type1, identifier2: type2 }
syntax, and initialize them using
{ identifier1: expression1, identifier2: expression2 }
.
You may have a trailing ,
after the last expression or type.
Enums
Define an enumeration with the enum
keyword:
Enum values can be referenced by using the name of the enum and the name of the value
separated by a dot. (eg: CardSuit.spade
)
The name of the enum can be omitted in bindings of the type of that enum, or if the return value of a callback is of that enum.
The default value of each enum type is always the first value.
© 2024 SixtyFPS GmbH