Enums are considered as bytes so you can have the last entry in your enum be “MAX” and just get the byte value of MAX - 1