Complete.Org: Mailing Lists: Archives: freeciv-ai: May 2002:
[freeciv-ai] Re: Generalised improvements AI support

[freeciv-ai] Re: Generalised improvements AI support

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Cc: Freeciv-ai <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: Generalised improvements AI support
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Wed, 08 May 2002 23:45:09 -0400

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.

>"There are 10 types of people in the world. Those who understand binary
>and those who don't."


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