summaryrefslogtreecommitdiff
path: root/src/imports/location/tilespec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/location/tilespec.cpp')
-rw-r--r--src/imports/location/tilespec.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/imports/location/tilespec.cpp b/src/imports/location/tilespec.cpp
new file mode 100644
index 00000000..5123d844
--- /dev/null
+++ b/src/imports/location/tilespec.cpp
@@ -0,0 +1,56 @@
+
+#include "tilespec.h"
+
+TileSpec::TileSpec()
+ : zoom_(-1),
+ x_(-1),
+ y_(-1) {}
+
+TileSpec::TileSpec(int zoom, int x, int y)
+ : zoom_(zoom),
+ x_(x),
+ y_(y) {}
+
+void TileSpec::setZoom(int zoom)
+{
+ zoom_ = zoom;
+}
+
+int TileSpec::zoom() const
+{
+ return zoom_;
+}
+
+void TileSpec::setX(int x)
+{
+ x_ = x;
+}
+
+int TileSpec::x() const
+{
+ return x_;
+}
+
+void TileSpec::setY(int y)
+{
+ y_ = y;
+}
+
+int TileSpec::y() const
+{
+ return y_;
+}
+
+bool TileSpec::operator < (const TileSpec &rhs) const
+{
+ if (zoom_ < rhs.zoom_)
+ return true;
+ if (zoom_ > rhs.zoom_)
+ return false;
+ if (x_ < rhs.x_)
+ return true;
+ if (x_ > rhs.x_)
+ return false;
+ return (y_ < rhs.y_);
+
+}