View Single Post
  #20  
Old 05-06-2007, 01:57 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Twinny View Post
They can be useful if you know how to use them well. Stuff like using enums for every month of the year. Gives them the appropriate monthly number. Can also be used for things like colours. It may be easier to use 'purple' rather than a 3 in code.

Another example could be parameters. Say a function takes an integer as a parameter to change the object. For instance, a baddy and it's mode. It may be easier for people to understand if they send 'attack' rather than a 3 as a parameter. In essence, the number 3 will still be sent as the parameter but the code will make more sense for the programmer.

Enums are a method of documentation. They have there uses. I think it's much more efficient to use enums to represent integer values rather than creating a TStaticVar() for them.
How about posting examples how it can be useful.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote