summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-12 23:33:39 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-03-12 23:33:39 +0100
commitfcc5b3c1ba9c3737b7df0fcfac614d92ba3cbd92 (patch)
treeb80318d173eee6610ac6a7ea93bf185662481041 /src/utils
parent570603e174bd98f4fa0facf0ad1d88eddef9feea (diff)
downloadmanaserv-fcc5b3c1ba9c3737b7df0fcfac614d92ba3cbd92.tar.gz
manaserv-fcc5b3c1ba9c3737b7df0fcfac614d92ba3cbd92.tar.xz
manaserv-fcc5b3c1ba9c3737b7df0fcfac614d92ba3cbd92.zip
Added a simple function to easily cout point coordinates.
Reviewed-by: Jaxad0127.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/point.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/utils/point.h b/src/utils/point.h
index 0ebc37c..8436b8c 100644
--- a/src/utils/point.h
+++ b/src/utils/point.h
@@ -1,6 +1,6 @@
/*
* The Mana Server
- * Copyright (C) 2004-2010 The Mana World Development Team
+ * Copyright (C) 2004-2011 The Mana World Development Team
*
* This file is part of The Mana Server.
*
@@ -22,6 +22,8 @@
#define POINT_H
#include <algorithm>
+#include <string>
+#include <sstream>
/**
* A point in positive space. Usually represents pixel coordinates on a map.
@@ -58,6 +60,13 @@ class Point
{
return (x != other.x || y != other.y);
}
+
+ std::string str() const
+ {
+ std::ostringstream ssPoint;
+ ssPoint << "(" << x << ", " << y << ")";
+ return ssPoint.str();
+ }
};
/**