Complete.Org: Mailing Lists: Archives: freeciv-ai: December 2004:
[freeciv-ai] Re: (PR#9610) AI movemap

[freeciv-ai] Re: (PR#9610) AI movemap

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [freeciv-ai] Re: (PR#9610) AI movemap
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Tue, 21 Dec 2004 14:47:01 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: >

On Tue, 21 Dec 2004, Benedict Adamson wrote:

> <URL: >
> Per I. Mathisen wrote:
> ...
> > I am not too hot on your fix, though. Using genlists directly is bad. I
> > think perhaps using a specvec here might be better. We know how big to
> > make it beforehand
> ...
> I don't think we do know how large to make the vector before recording
> things in it. Each vector records the IDs of all the units that that can
> reach a particular tile in one (or two) turns. How can we know that
> before computing the movemap? If specvec provided a push_back function,
> as the std::vector template of C++  does, we could use a specvec.
> Or am I missing something?

See the vector_reserve and vector_append functions.

> Note that the genlist are never used directly outside the movemap code
> itself; the provided movemap_iterate_one_turn and
> movemap_iterate_two_turn macros hide it.

Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa

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