Automatically generate the server_type enum from games.xml to reduce hand-written code and avoid sneaky sorting errors
use UNKNOWN_SERVER everytime there is GAMES_TOTAL
GAMES_TOTAL is equal to UNKNOWN_SERVER and the GAMES_TOTAL name is ambiguous because people can believe it's the amount of games including UNKNOWN_SERVER.
Using UNKNOWN_SERVER instead of GAMES_TOTAL makes explicit that a code like that is listing every games except the unknown one:
server_type
enum fromgames.xml
Automatically generate the
server_type
enum fromgames.xml
to reduce hand-written code and avoid sneaky sorting errorsUNKNOWN_SERVER
everytime there isGAMES_TOTAL
GAMES_TOTAL
is equal toUNKNOWN_SERVER
and theGAMES_TOTAL
name is ambiguous because people can believe it's the amount of games includingUNKNOWN_SERVER
.Using
UNKNOWN_SERVER
instead ofGAMES_TOTAL
makes explicit that a code like that is listing every games except the unknown one: