summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-31 02:55:26 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-01-31 02:55:26 +0000
commitb0d28814ecdd29d3f33ab926b3ff3c325675e3b2 (patch)
tree57878c3e9900db640a34df7c319dbd930c18ab24 /src/map.cpp
parent3b1cb45812fe4308073057c27837bc0c69a5d35e (diff)
downloadmana-b0d28814ecdd29d3f33ab926b3ff3c325675e3b2.tar.gz
mana-b0d28814ecdd29d3f33ab926b3ff3c325675e3b2.tar.bz2
mana-b0d28814ecdd29d3f33ab926b3ff3c325675e3b2.tar.xz
mana-b0d28814ecdd29d3f33ab926b3ff3c325675e3b2.zip
Various small cleanups.
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),