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: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#6941) Mission Orders
From: "Arnstein Lindgard" <a-l@xxxxxxx>
Date: Wed, 28 Jan 2004 13:37:32 -0800
Reply-to: rt@xxxxxxxxxxx

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

> On Wed, 28 Jan 2004 10:42:25 -0800 Jason Short wrote:
> 
> > 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;
> > }
>...
> > If the type doesn't need to be associated with the union, how do you 
> > tell which type the union is?

Sorry, I missed that point. "type" is what I want to introduce
to hold

enum orders_type {
  GOTO_ORDERS, PATROL_ORDERS, STATIONARY_ORDERS
};

I previously suggested changing "has_orders" from a bool into
such a 3-item enum because my client needs more info, and you
said I should expand the unit struct. It's got nothing to do
with the union.

So far I have only one particular use for it:

An exhausted settler with orders to build city should display
neither "goto" nor "patrol" sprite.

I.e. the settler only has a "B" sprite on the last tile in the
path so you can see what it wants to do.

Guest wrote:
switch ((int)order.composite.order) {
case ORDER.MOVE:
...
case ACTIVITY_SENTRY:
...
case ACTION_UNLOAD:
...
}

Let's do that then.


Arnstein




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