diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-25 02:26:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-25 02:26:34 +0300 |
commit | c9f43996f3147100627ee2c6f9da993ceb160113 (patch) | |
tree | 7577f02f4658b19e05d586f66b67a9a4f5fedb7e /src/map.h | |
parent | 8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff) | |
download | manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2 manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz manaverse-c9f43996f3147100627ee2c6f9da993ceb160113.zip |
Improve iterators part 2.
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -43,6 +43,13 @@ class ObjectsLayer; typedef std::vector<Tileset*> Tilesets; typedef std::vector<MapLayer*> Layers; +typedef Layers::const_iterator LayersCIter; + +typedef std::vector<std::pair<MapLayer*, int> > TilePairVector; +typedef TilePairVector::const_iterator TilePairVectorCIter; + +typedef std::vector<AmbientLayer*> AmbientLayerVector; +typedef AmbientLayerVector::const_iterator AmbientLayerVectorCIter; /** * A meta tile stores additional information about a location on a tile map. @@ -84,11 +91,14 @@ class TileAnimation { mAffected.push_back(std::make_pair(layer, index)); } private: - std::vector<std::pair<MapLayer*, int> > mAffected; + TilePairVector mAffected; SimpleAnimation *mAnimation; Image *mLastImage; }; +typedef std::map<int, TileAnimation*> TileAnimationMap; +typedef TileAnimationMap::const_iterator TileAnimationMapCIter; + /** * A tile map. */ @@ -422,8 +432,8 @@ class Map : public Properties, public ConfigListener unsigned mOnClosedList, mOnOpenList; // Overlay data - std::vector<AmbientLayer*> mBackgrounds; - std::vector<AmbientLayer*> mForegrounds; + AmbientLayerVector mBackgrounds; + AmbientLayerVector mForegrounds; float mLastAScrollX; float mLastAScrollY; // bool mSpritesUpdated; |