Follow-up Comment #6, patch #1033 (project wesnoth):
Thanks for adding the nice get_tiles_in_radius() function.
I agree with cjhopman's comment though: it'd be faster to iterate through
units. This is also quite doable already using the formula AI:
def close_enemies(ai*, hex, radius) filter(enemy_units, distance_between(hex,
loc) <= radius)
I suspect that doing it like this using the formula system would often
actually be faster than your current C++ implementation.
You might like to reconsider how useful this function will be, since it can
already be implemented in the formula AI (it might be useful though since the
C++ implementation will be faster). However in any case it should be
re-written to search through the units.
Please keep the utility functions you added though. They are useful for us
for other purposes.
--David
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1033>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs