diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-09 23:16:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-12 01:30:01 +0300 |
commit | 0671c9981e922e37b8caacc84abfceb60b32aaff (patch) | |
tree | 7e5b40d7131e0b6b091475df0ed27766b6845391 /src/tileset.h | |
parent | 5692fe8584be17966f7bed2e97d22139f71619e3 (diff) | |
download | mv-0671c9981e922e37b8caacc84abfceb60b32aaff.tar.gz mv-0671c9981e922e37b8caacc84abfceb60b32aaff.tar.bz2 mv-0671c9981e922e37b8caacc84abfceb60b32aaff.tar.xz mv-0671c9981e922e37b8caacc84abfceb60b32aaff.zip |
Add support for tileset properties.
Diffstat (limited to 'src/tileset.h')
-rw-r--r-- | src/tileset.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tileset.h b/src/tileset.h index c21d6948a..5c21e8835 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -47,8 +47,28 @@ class Tileset : public ImageSet int getFirstGid() const { return mFirstGid; } + /** + * Set tileset property. + */ + void setProperties(std::map<std::string, std::string> props) + { mProperties = props; } + + /** + * Returns property value. + */ + std::string getProperty(std::string name) + { + std::map<std::string, std::string>::const_iterator + it = mProperties.find(name); + if (it == mProperties.end()) + return ""; + return mProperties[name]; + } + private: int mFirstGid; + + std::map<std::string, std::string> mProperties; }; #endif |