[freeciv-ai] Re: (PR#9610) AI movemap
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<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.
|
|