Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)
Home

[Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Arien Malec <arien_malec@xxxxxxxxx>
Cc: Trent Piepho <xyzzy@xxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Pop cost patch (resending via bug system) (PR#897)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 08:26:08 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Aug 21, 2001 at 04:44:19PM -0700, Arien Malec wrote:
> Here's an add_to_city_status patch that actually compiles :-)

> Index: common/unit.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v
> retrieving revision 1.125
> diff -u -r1.125 unit.c
> --- common/unit.c     2001/08/13 12:25:26     1.125
> +++ common/unit.c     2001/08/21 23:37:44
> @@ -413,35 +413,42 @@
>  /**************************************************************************
>  ...
>  **************************************************************************/
> -int can_unit_add_to_city(struct unit *punit)
> +enum add_to_city_status unit_add_to_city_status (struct unit *punit)

What do think about {general,basic}_unit_add_to_city?

> +/**************************************************************************
> +...
> +**************************************************************************/
> +int can_unit_add_to_city(struct unit *punit)
> +{
> +  return (unit_add_to_city_status (punit) == ADD_OK);
>  }
>  
> +enum add_to_city_status {
> +  ADD_OK, /* Unit OK to add to city */
> +  ADD_NO_MOVES, /* Unit does not have moves left */
> +  ADD_NOT_AT_CITY, /* Unit is not at a city */
> +  ADD_NOT_OWNER, /* Owner of unit is not owner of city */
> +  ADD_NOT_ADDABLE_UNIT, /* Unit is not one that can be added to cities */
> +  ADD_TOO_BIG, /* City is too big to be added to */
> +  ADD_NO_AQUEDUCT, /* Adding takes city past limit for aquaduct but
> +                   city has no aquaduct */
> +  ADD_NO_SEWER /* Adding takes city past limit for sewer but city
> +               has no sewer */
> +};

Since ADD_ isn't this rare what about prefixing these with ATCS_
(AddToCityStatus) or something similar?

If you further cleanup handle_unit_build_city there will be an
immediate benefit and I will apply this patch.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
 "That's nothing, if you play it forward, it installs NT-4.0"


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