change some deque to vectors

This commit is contained in:
Eduardo Bart 2011-08-27 21:07:38 -03:00
parent 3d4556e5c9
commit 7962fbec19
3 changed files with 6 additions and 7 deletions

View File

@ -26,6 +26,5 @@ typedef std::shared_ptr<UIVerticalLayout> UIVerticalLayoutPtr;
typedef std::shared_ptr<UIAnchorLayout> UIAnchorLayoutPtr; typedef std::shared_ptr<UIAnchorLayout> UIAnchorLayoutPtr;
typedef std::deque<UIWidgetPtr> UIWidgetList; typedef std::deque<UIWidgetPtr> UIWidgetList;
typedef std::deque<UIWidgetWeakPtr> UIWeakWidgetList;
#endif #endif

View File

@ -86,7 +86,7 @@ void Map::draw(const Rect& rect)
for(int iy = -5; iy <= 5; ++iy) { for(int iy = -5; iy <= 5; ++iy) {
Position itemPos = Position(playerPos.x + ix, playerPos.y + iy, playerPos.z); Position itemPos = Position(playerPos.x + ix, playerPos.y + iy, playerPos.z);
if(const TilePtr& tile = m_tiles[itemPos]) { if(const TilePtr& tile = m_tiles[itemPos]) {
std::deque<ThingPtr> creatures = tile->getCreatures(); std::vector<ThingPtr> creatures = tile->getCreatures();
for(auto it = creatures.rbegin(), end = creatures.rend(); it != end; ++it) { for(auto it = creatures.rbegin(), end = creatures.rend(); it != end; ++it) {
const ThingPtr& thing = *it; const ThingPtr& thing = *it;
const CreaturePtr& creature = thing->asCreature(); const CreaturePtr& creature = thing->asCreature();

View File

@ -22,15 +22,15 @@ public:
int getStackSize(int stop); int getStackSize(int stop);
std::deque<ThingPtr> getCreatures() { return m_creatures; } std::vector<ThingPtr> getCreatures() { return m_creatures; }
int getDrawNextOffset() { return m_drawNextOffset; } int getDrawNextOffset() { return m_drawNextOffset; }
private: private:
ThingPtr m_ground; ThingPtr m_ground;
std::deque<ThingPtr> m_itemsBottom; std::vector<ThingPtr> m_itemsBottom;
std::deque<ThingPtr> m_creatures; std::vector<ThingPtr> m_creatures;
std::deque<ThingPtr> m_itemsTop; std::vector<ThingPtr> m_itemsTop;
std::deque<ThingPtr> m_effects; std::vector<ThingPtr> m_effects;
int m_drawNextOffset; int m_drawNextOffset;
}; };