Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] Re: (PR#6941) Mission Orders
Home

[Freeciv-Dev] Re: (PR#6941) Mission Orders

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6941) Mission Orders
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 28 Jan 2004 10:42:25 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6941 >

Arnstein Lindgard wrote:

>>What about
>>something like
>>
>>struct unit_order {
>>  enum orders_type type;
>>  union {
>>    enum unit_orders order;
>>    enum unit_activity activity;
>>    enum unit_actions action;
>>    enum diplomat_actions diplomat;
>>  };
>>  enum direction8 dir;
>>}
> 
> 
> That's specific to gnu C. The union needs a name to work with C99.
> "type" is server -> client information for sprite purposes, I don't
> think the client will ever need to send that.

Hmm, I think I meant

struct unit_order {
   enum orders_type type;
   union {
     enum unit_orders order;
     enum unit_activity activity;
     enum unit_actions action;
     enum diplomat_actions diplomat;
   } order;
   enum direction8 dir;
}

Is this also illegal?  It does have a name now.

If the type doesn't need to be associated with the union, how do you 
tell which type the union is?  How do you know whether a 0 is the first 
order or the first activity?

jason




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