diff --git a/TileGenerator.cpp b/TileGenerator.cpp index 54adab2..de86fb6 100644 --- a/TileGenerator.cpp +++ b/TileGenerator.cpp @@ -235,9 +235,22 @@ void TileGenerator::renderMap() } std::list zlist = getZValueList(); - for (std::list::iterator position = zlist.begin(); position != zlist.end(); ++position) { - int zPos = *position; - getBlocksOnZ(zPos, statement); + for (std::list::iterator zPosition = zlist.begin(); zPosition != zlist.end(); ++zPosition) { + int zPos = *zPosition; + map blocks = getBlocksOnZ(zPos, statement); + for (std::list >::const_iterator position = m_positions.begin(); position != m_positions.end(); ++position) { + if (position->second != zPos) { + continue; + } + + int xPos = position->first; + blocks[xPos].sort(); + const BlockList &blockStack = blocks[xPos]; + for (BlockList::const_iterator it = blockStack.begin(); it != blockStack.end(); ++it) { + std::cout << it->first.y << std::endl; + } + std::cout << "---" << std::endl; + } } } diff --git a/TileGenerator.h b/TileGenerator.h index e05f385..61b760b 100644 --- a/TileGenerator.h +++ b/TileGenerator.h @@ -29,6 +29,28 @@ struct BlockPos { int x; int y; int z; + bool operator<(const BlockPos& p) const + { + if (z > p.z) { + return true; + } + if (z < p.z) { + return false; + } + if (y > p.y) { + return true; + } + if (y < p.y) { + return false; + } + if (x > p.x) { + return true; + } + if (x < p.x) { + return false; + } + return false; + } }; class DbError {