Re: (PR#9610) AI movemap
"Benedict Adamson" <[email protected]> Sat, 20 Nov 2004 16:47:51 -0800
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
<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.