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{a, b, c};
is sort of like:
PHP Code:
foo.a = 0;
foo.b = 1;
foo.c = 2;
You can also do:
PHP Code:
enum foo{a = 4, b = 8, c = 10}; //4, 8, 10 are arbitrary
Which is like:
PHP Code:
foo.a = 4;
foo.b = 8;
foo.c = 10;