Thread: enum
View Single Post
  #4  
Old 05-17-2006, 04:00 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Yen
this.action = MODE.FOLLOW;
From what I remember about enumerated types, that would give this.action the value of 0. (this.action = MODE.ATTACK //this.action is 2).

It's used mostly so that you don't have to remember '2' means attack. You can just use MODE.ATTACK instead.

Examples:
PHP Code:
enum foo{abc}; 
is sort of like:
PHP Code:
foo.0;
foo.1;
foo.2
You can also do:
PHP Code:
enum foo{4810}; //4, 8, 10 are arbitrary 
Which is like:
PHP Code:
foo.4;
foo.8;
foo.10
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote