diff options
| author | void_17 <61356189+void2012@users.noreply.github.com> | 2026-03-06 02:11:18 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-06 02:11:18 +0700 |
| commit | 55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch) | |
| tree | 953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/StructureStart.cpp | |
| parent | 7d6658fe5b3095f35093701b5ab669ffc291e875 (diff) | |
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.World/StructureStart.cpp')
| -rw-r--r-- | Minecraft.World/StructureStart.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Minecraft.World/StructureStart.cpp b/Minecraft.World/StructureStart.cpp index 9e5ba0a8..3f22b4a7 100644 --- a/Minecraft.World/StructureStart.cpp +++ b/Minecraft.World/StructureStart.cpp @@ -21,9 +21,9 @@ StructureStart::StructureStart(int x, int z) StructureStart::~StructureStart() { - for(AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ ) + for(auto& piece : pieces) { - delete (*it); + delete piece; } delete boundingBox; } @@ -40,9 +40,9 @@ list<StructurePiece *> *StructureStart::getPieces() void StructureStart::postProcess(Level *level, Random *random, BoundingBox *chunkBB) { - AUTO_VAR(it, pieces.begin()); + auto it = pieces.begin(); - while( it != pieces.end() ) + while( it != pieces.end() ) { if( (*it)->getBoundingBox()->intersects(chunkBB) && !(*it)->postProcess(level, random, chunkBB)) { @@ -61,9 +61,8 @@ void StructureStart::calculateBoundingBox() { boundingBox = BoundingBox::getUnknownBox(); - for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ ) + for(auto& piece : pieces) { - StructurePiece *piece = *it; boundingBox->expand(piece->getBoundingBox()); } } @@ -78,9 +77,8 @@ CompoundTag *StructureStart::createTag(int chunkX, int chunkZ) tag->put(L"BB", boundingBox->createTag(L"BB")); ListTag<CompoundTag> *childrenTags = new ListTag<CompoundTag>(L"Children"); - for(AUTO_VAR(it, pieces.begin()); it != pieces.end(); ++it) + for(auto& piece : pieces) { - StructurePiece *piece = *it; childrenTags->add(piece->createTag()); } tag->put(L"Children", childrenTags); @@ -133,9 +131,8 @@ void StructureStart::moveBelowSeaLevel(Level *level, Random *random, int offset) // move all bounding boxes int dy = y1Pos - boundingBox->y1; boundingBox->move(0, dy, 0); - for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ ) + for(auto& piece : pieces) { - StructurePiece *piece = *it; piece->getBoundingBox()->move(0, dy, 0); } } @@ -157,9 +154,8 @@ void StructureStart::moveInsideHeights(Level *level, Random *random, int lowestA // move all bounding boxes int dy = y0Pos - boundingBox->y0; boundingBox->move(0, dy, 0); - for( AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++ ) + for(auto& piece : pieces) { - StructurePiece *piece = *it; piece->getBoundingBox()->move(0, dy, 0); } } |
