Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] Re: (PR#13474) a city_production struct
Home

[Freeciv-Dev] Re: (PR#13474) a city_production struct

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#13474) a city_production struct
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 15 Jul 2005 15:50:20 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13474 >

On Thu, 14 Jul 2005, Jason Short wrote:

>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=13474 >
>
> This patch changes pcity->is_building_unit and pcity->currently_building
> into a separate struct.  The new values are pcity->production.is_unit
> and pcity->production.value.
>
> Reasons: the main reason is that this struct will be rather useful
> elsewhere.  The cid and wid values the client uses should be replaced
> with it.  Existing functions that take a
> currently_building+is_building_unit values should instead take a
> city_production struct.
>
> Caveats: I considered using a union for the typedef, or using an enum
> for is_unit (both like req_source does).  I decided against it for now
> since there are only units and imprs and both are represented by
> integers.  However at some point in the future this may change.

Why not do it the other way around? i.e. Replace pcity->is_building_unit
and pcity->currently_building with pcity->production which is a cid or
wid, whatever?

A unique identifier for things which can be produced at a city is useful
in lots of places and I am uncertain turning this into a struct is a very
good idea.

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa







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