refactor: expand AUTO_VAR macro

This commit is contained in:
Tropical
2026-03-29 23:59:05 -05:00
parent a330ecdcbb
commit e45151ae64
201 changed files with 1051 additions and 1055 deletions

View File

@@ -17,7 +17,7 @@ StructureStart::StructureStart(int x, int z) {
}
StructureStart::~StructureStart() {
for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) {
for (auto it = pieces.begin(); it != pieces.end(); it++) {
delete (*it);
}
delete boundingBox;
@@ -29,7 +29,7 @@ std::list<StructurePiece*>* StructureStart::getPieces() { return &pieces; }
void StructureStart::postProcess(Level* level, Random* random,
BoundingBox* chunkBB) {
AUTO_VAR(it, pieces.begin());
auto it = pieces.begin();
while (it != pieces.end()) {
if ((*it)->getBoundingBox()->intersects(chunkBB) &&
@@ -46,7 +46,7 @@ void StructureStart::postProcess(Level* level, Random* random,
void StructureStart::calculateBoundingBox() {
boundingBox = BoundingBox::getUnknownBox();
for (AUTO_VAR(it, pieces.begin()); it != pieces.end(); it++) {
for (auto it = pieces.begin(); it != pieces.end(); it++) {
StructurePiece* piece = *it;
boundingBox->expand(piece->getBoundingBox());
}
@@ -61,7 +61,7 @@ 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 it = pieces.begin(); it != pieces.end(); ++it) {
StructurePiece* piece = *it;
childrenTags->add(piece->createTag());
}
@@ -107,7 +107,7 @@ void StructureStart::moveBelowSeaLevel(Level* level, Random* random,
// 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 it = pieces.begin(); it != pieces.end(); it++) {
StructurePiece* piece = *it;
piece->getBoundingBox()->move(0, dy, 0);
}
@@ -128,7 +128,7 @@ void StructureStart::moveInsideHeights(Level* level, Random* random,
// 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 it = pieces.begin(); it != pieces.end(); it++) {
StructurePiece* piece = *it;
piece->getBoundingBox()->move(0, dy, 0);
}