[Freeciv-Dev] Re: AI cleanup: enum choice_type
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Friday 12 January 2001 09:54, Marko Lindqvist wrote:
> Replace hardcoded ai_choice.type values with enum values.
>
>
> Caz
What is happening here? (CT_NONE == CT_BUILDING) shouldn't need to be
checked....
+enum choice_type { CT_NONE = 0, CT_BUILDING = 0, CT_NONMIL, CT_ATTACKER,
+ CT_DEFENDER, CT_LAST };
+
+
+#define ASSERT_REAL_CHOICE_TYPE(type) \
+ assert(type >= 0 && type < CT_LAST && \
+ (CT_NONE == CT_BUILDING || type != CT_NONE));
+
-Thue
|
|