Author: alink
Date: Sat Nov 21 18:54:38 2009
New Revision: 39858

URL: http://svn.gna.org/viewcvs/wesnoth?rev=39858&view=rev
Log:
add a debug function to print a vector of locations

Modified:
    trunk/src/map_location.cpp
    trunk/src/map_location.hpp

Modified: trunk/src/map_location.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/map_location.cpp?rev=39858&r1=39857&r2=39858&view=diff
==============================================================================
--- trunk/src/map_location.cpp (original)
+++ trunk/src/map_location.cpp Sat Nov 21 18:54:38 2009
@@ -35,6 +35,13 @@
 
 std::ostream &operator<<(std::ostream &s, map_location const &l) {
        s << (l.x + 1) << ',' << (l.y + 1);
+       return s;
+}
+std::ostream &operator<<(std::ostream &s, std::vector<map_location> const &v) {
+       std::vector<map_location>::const_iterator i = v.begin();
+       for(; i!= v.end(); ++i) {
+               s << "(" << *i << ") ";
+       }
        return s;
 }
 

Modified: trunk/src/map_location.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/map_location.hpp?rev=39858&r1=39857&r2=39858&view=diff
==============================================================================
--- trunk/src/map_location.hpp (original)
+++ trunk/src/map_location.hpp Sat Nov 21 18:54:38 2009
@@ -128,5 +128,7 @@
 
 /** Dumps a position on a stream, for debug purposes. */
 std::ostream &operator<<(std::ostream &s, map_location const &l);
+/** Dumps a vector of positions on a stream, for debug purposes. */
+std::ostream &operator<<(std::ostream &s, std::vector<map_location> const &v);
 
 #endif


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to