Follow-up Comment #10, patch #1020 (project wesnoth):
well, it's retrievable but it still has some issues.
1) you forgot to assert(valid()) for dereferencing "normal"
unit_map::iterators
2) also, just an aesthetics thing but this is wordier and less informative
assert than what I suggested: "if(!find_pair()) assert(0);"
3) unit_map::unit_by_loc_iterator just an aesthetics thing again but I would
rename this could cause confusion with the type 3 iterator suggestion--
unit_map::unit_xy_iterator (Type 2)
unit_map::xy_iterator (Type 3)
4) kind of goes without saying, but, you have tested this right? There may be
some logic errors I am missing with incrementing the revision_number or with
operator++. I am not too sure how well those ++ methods work since they
depend heavily on the state of the unit map at the time the iterator was
created. Furthermore, I don't see the need to do a special pointer increment.
You can just iterate the same way as usual, using the underlying unit map.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?1020>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs