Anchor
This article merely explains the anchor syntax in Genesis. For more information about the feature itself, please read the anchor article in the engine menu.
Syntax
The anchor syntax is pretty straightforward - you just put the anchor
keyword in front of
a class/enum/class property/enum case declaration.
Let's take a look at some examples.
Anchored class
anchor class User {
var username: string
}
Anchored enum case
enum Color: int {
case Blue
case Red
case Yellow
anchor case Unknown
}