summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 248c07d0..d249426a 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -33,21 +33,27 @@
#include "resources/image.h"
-MetaTile::MetaTile():
- whichList(0)
-{
-}
-
-
-Location::Location(int iX, int iY, MetaTile *iTile):
- x(iX), y(iY), tile(iTile)
+/**
+ * A location on a tile map. Used for pathfinding, open list.
+ */
+struct Location
{
-}
+ /**
+ * Constructor.
+ */
+ Location(int px, int py, MetaTile *ptile):x(px),y(py),tile(ptile) {};
+
+ /**
+ * Comparison operator.
+ */
+ bool operator< (const Location &loc) const
+ {
+ return tile->Fcost > loc.tile->Fcost;
+ }
-bool Location::operator< (const Location &loc) const
-{
- return tile->Fcost > loc.tile->Fcost;
-}
+ int x, y;
+ MetaTile *tile;
+};
Map::Map(int width, int height, int tileWidth, int tileHeight):
mWidth(width), mHeight(height),