Quote:
Originally Posted by JasonRiggs
It won't lag in game, it might lag the compiler, although, You are defining it the right way, and if you want to not have this lag problem, You can delete that define and just use its ID in ShowPlayerDialog, And store the ID in a notepad on your pc or something.
|
That is the worst thing I've ever read on here. Okay kidding, not that bad, but still...
Just use defines if you're cool with re-ordering them once in a while (or leave some free ids between each, either way that's totally cool and will not "lag" anything).
Use enums if you want to make it simple (because it really is the most simple thing regarding this - and it will not "lag" your server or compiler).
Neither is going to influence the speed of the server, and the compile time difference between actual numbers, defines and enumerations is
negligible.
As Vince said, enums are constants.
and
are exactly the same after compiling. Even using enumerations for arrays is nothing else than a constant number replaced with a word which is easier for us humans to read (tags (or data types) also aren't neccessary to declare in enums, but it's just easier for us)...
An enum as suchs doesn't even exist after compiling.