Our enum type ServerState has an underlying int type.
The possible values for ServerState are defined as constants.
By implementing the __tostring method in Lua, 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 absence of strict type enforcement in Lua means this provides some degree of runtime checks for enums.
transition emulates a state transition for a server; it takes the existing state and returns a new state.