The possible values for ServerState are defined as constants. The special keyword enum generates successive constant values automatically; in this case 0, 1, 2, and so on.
By implementing the Stringer interface, values of ServerState can be printed out or converted to strings.
If we have a value of type int, we cannot pass it to transition - the compiler will complain about type mismatch. This provides some degree of compile-time type safety for enums.
To run this script, you would typically use it within an environment that supports Angelscript. Now that we can run and build basic Angelscript programs, let’s learn more about the language.