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

[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: "Benedict Adamson" <badamson@xxxxxxxxxxx>
Date: Sat, 20 Nov 2004 16:47:51 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9610 >

I'm using the movemap code in a redesign of the bodyguard code (see 
PR#10694).

The movemap stores for each tile a struct holding two unit lists: 
one_turn and two_turn. There is therefore repeated code, where an 
operation is performed on the one_turn list and then on the two_turn 
list. In the bodyguard code I'm writing, this repetition is particularly 
ugly.

I think it would be better to store a fixed-length array of lists, with 
the length #define-d as 2, and using loops over the array of lists 
instead of duplicating code. This would give the further benefit of 
making it a trivial change to increase the look-ahead above 2 turns.





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