Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#6931) Returning GR_FAILED in execute_orders doesn't ca
Home

[Freeciv-Dev] (PR#6931) Returning GR_FAILED in execute_orders doesn't ca

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: a-l@xxxxxxx
Subject: [Freeciv-Dev] (PR#6931) Returning GR_FAILED in execute_orders doesn't cancel unit orders
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Jan 2004 17:35:43 -0800
Reply-to: rt@xxxxxxxxxxx

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

> [i-freeciv-lists@xxxxxxxxxxxxx - Sun Jan 25 07:59:16 2004]:

> > Execute_orders should just return a bool indicating whether the unit
> > survives.  Any other handling should be done within the function. 
> > Perhaps a wrapper function would be helpful (to handle the different
> > return values).  If not then the GR_*** enumeration can just be dropped.
> 
> I'm for the wrapper. Else the functions grow too much.

A wrapper or sub-function saves 6 lines of code - fewer lines than it
would take to write the extra function.

A wrapper is bad in any case since we would have a 3-fold return value
that needed a new enum:

  OR_DEAD
  OR_DONE
  OR_CANCELLED

which is unnecessary.  The goto_result shouldn't be re-used since it is
intended for a different purpose.

jason



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