Should probably use the enum as type instead of uint8 and then no check.
The function is being fed the enum values anyways in the code so there is no need for type casting from int to enum.