diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-06-14 09:27:43 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-06-14 09:27:43 +0000 |
commit | d7904f7b7e25bbdd7205e5c18e06d184b2078732 (patch) | |
tree | 7f19693da61eb4a5944c220d3085530fd2e2a407 /src/map.cpp | |
parent | 24b1c618a11170e825598c5e22bf71f9238eae52 (diff) | |
download | mana-d7904f7b7e25bbdd7205e5c18e06d184b2078732.tar.gz mana-d7904f7b7e25bbdd7205e5c18e06d184b2078732.tar.bz2 mana-d7904f7b7e25bbdd7205e5c18e06d184b2078732.tar.xz mana-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.cpp | 22 |
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) { |