12.09.2017, 11:28
Quote:
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.
|
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.
Код:
enum { test };
Код:
#define test 0
An enum as suchs doesn't even exist after compiling.