[freeciv-ai] Re: Generalised improvements AI support
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
At 10:29 PM 02/05/06 +0200, Per I. Mathisen wrote:
>On Mon, 6 May 2002, Raimar Falke wrote:
>> > /** This goes in a Building Evaluation Agent or something **/
>>
>> > /* Create a virtual city out of pcity.
>>
>> I'm not a friend of this approach. It is neither very clean (you just
>> don't which field are used and which fields needs initializing) nor
>> does it extend very good (since you don't know which fields are used
>> you have to set them all). I know that the other approach (passing all
>> the required field as parameter or in a struct) is also not this
>> nice. But it is cleaner.
>
>I don't understand what you're driving at here, Raimar. This cloning can
>be implemented with a very simple memcpy() call.
There are very few pointers in the key structs, so you don't often
have to worry about deep vs shallow copy concerns.
But the various lists will be shared and clone operations could do
bad things to the real city.
Similarly, most of the reallocate worker operations tend to percolate
back to the real map, and this would leave the real city out-of-sync.
There are probably a lot of issues with "clone" operations that will
be found out the hard way.
>Yours,
>Per
>
>"There are 10 types of people in the world. Those who understand binary
>and those who don't."
Cheers,
RossW
=====
- [freeciv-ai] Generalised improvements AI support, Ben Webb, 2002/05/06
- [freeciv-ai] Re: Generalised improvements AI support, Ben Webb, 2002/05/06
- [freeciv-ai] Re: Generalised improvements AI support, Per I. Mathisen, 2002/05/06
- [freeciv-ai] Re: Generalised improvements AI support, Raahul Kumar, 2002/05/07
- [freeciv-ai] Re: Generalised improvements AI support, Raimar Falke, 2002/05/07
- [freeciv-ai] Re: Generalised improvements AI support, Raahul Kumar, 2002/05/07
- [freeciv-ai] Re: Generalised improvements AI support, Raimar Falke, 2002/05/07
- [freeciv-ai] Re: Generalised improvements AI support, Ben Webb, 2002/05/08
- [freeciv-ai] Re: Generalised improvements AI support, Ben Webb, 2002/05/08
- [freeciv-ai] Re: Generalised improvements AI support, Ben Webb, 2002/05/08
- [freeciv-ai] Re: Generalised improvements AI support, Per I. Mathisen, 2002/05/07
|
|