mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-03 12:56:32 +00:00
refactor: expand AUTO_VAR macro
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user