summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-06-14 09:27:43 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-06-14 09:27:43 +0000
commitd7904f7b7e25bbdd7205e5c18e06d184b2078732 (patch)
tree7f19693da61eb4a5944c220d3085530fd2e2a407 /src/map.cpp
parent24b1c618a11170e825598c5e22bf71f9238eae52 (diff)
downloadmana-client-d7904f7b7e25bbdd7205e5c18e06d184b2078732.tar.gz
mana-client-d7904f7b7e25bbdd7205e5c18e06d184b2078732.tar.bz2
mana-client-d7904f7b7e25bbdd7205e5c18e06d184b2078732.tar.xz
mana-client-d7904f7b7e25bbdd7205e5c18e06d184b2078732.zip
Added support for map properties, which minimap and background music
functionality can be based upon.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 5f522dfb..24c9b5b4 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -177,6 +177,28 @@ int Map::getTileHeight()
return tileHeight;
}
+std::string Map::getProperty(const std::string &name)
+{
+ std::map<std::string,std::string>::iterator i = properties.find(name);
+
+ if (i != properties.end())
+ {
+ return (*i).second;
+ }
+
+ return "";
+}
+
+bool Map::hasProperty(const std::string &name)
+{
+ return (properties.find(name) != properties.end());
+}
+
+void Map::setProperty(const std::string &name, const std::string &value)
+{
+ properties[name] = value;
+}
+
std::list<PATH_NODE> Map::findPath(
int startX, int startY, int destX, int destY)
{