From 0671c9981e922e37b8caacc84abfceb60b32aaff Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 9 Aug 2012 23:16:24 +0300 Subject: Add support for tileset properties. --- src/tileset.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/tileset.h') 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 props) + { mProperties = props; } + + /** + * Returns property value. + */ + std::string getProperty(std::string name) + { + std::map::const_iterator + it = mProperties.find(name); + if (it == mProperties.end()) + return ""; + return mProperties[name]; + } + private: int mFirstGid; + + std::map mProperties; }; #endif -- cgit v1.2.3-60-g2f50