summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-25 02:26:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-25 02:26:34 +0300
commitc9f43996f3147100627ee2c6f9da993ceb160113 (patch)
tree7577f02f4658b19e05d586f66b67a9a4f5fedb7e /src/map.h
parent8e19f9b9d792cf4d3d3b022fd26a258c3d3d97bf (diff)
downloadmanaplus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.gz
manaplus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.bz2
manaplus-c9f43996f3147100627ee2c6f9da993ceb160113.tar.xz
manaplus-c9f43996f3147100627ee2c6f9da993ceb160113.zip
Improve iterators part 2.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/map.h b/src/map.h
index 53698ea03..f9821f7e0 100644
--- a/src/map.h
+++ b/src/map.h
@@ -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;