Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: AI cleanup: enum choice_type
Home

[Freeciv-Dev] Re: AI cleanup: enum choice_type

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Marko Lindqvist <caz@xxxxxxxxx>, Freeciv dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: AI cleanup: enum choice_type
From: Thue <thue@xxxxxxx>
Date: Fri, 12 Jan 2001 22:39:53 +0100

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



[Prev in Thread] Current Thread [Next in Thread]