[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 >
Vasco Alexandre da Silva Costa wrote:
> 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?
Because cid is an overloaded integer: not very pretty, not typesafe, etc.
> 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.
In that case I'd rather have a unique identifier for all items -
including techs, etc. Tech production works at the player level exactly
as unit/building production works at the city level.
If we were object-oriented we could use some sort of class hierarchy.
The C version would be to just use a void* (pointer-to-building,
pointer-to-unit, pointer-to-tech) and determine the type as needed.
Why does a unique identifier need to be an integer rather than a pointer
or a struct?
-jason
- [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, 2005/07/15
- [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 <=
- [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
|
|