[Freeciv-Dev] Re: (PR#13474) a city_production struct
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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 >
>
> I'd rather have
>
> struct {
> bool is_unit
> struct impr_type *building;
> struct unit_type *unit;
> };
My gut tells me all this replacement of ids and indexes with pointers will
eventually lead to tears, but whatever! :)
This should be using a union though:
struct {
enum prod_type type;
union {
struct impr_type *building;
struct unit_type *unit;
} item;
};
Wastes less memory, makes it more obvious there can only be one item at a
time, etc.
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Benoit Hudson, 2005/07/14
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/14
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct,
Vasco Alexandre da Silva Costa <=
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Benoit Hudson, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/15
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/16
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/17
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Vasco Alexandre da Silva Costa, 2005/07/18
- [Freeciv-Dev] Re: (PR#13474) a city_production struct, Jason Short, 2005/07/18
- [Freeciv-Dev] (PR#13474) a city_production struct, Jason Short, 2005/07/23
|
|