This commit is contained in:
Daniel Ledda
2021-06-02 08:50:52 +02:00
parent 3d7df31097
commit e7b8ae6120
50 changed files with 4609 additions and 2272 deletions

View File

@@ -96,4 +96,18 @@ export default class SomaSolution {
clone.solutionSpaces = this.solutionSpaces.slice();
return clone;
}
getDims() {
return [this.dim, this.dim, this.dim];
}
forEachCell(cb: (val: number, x: number, y: number, z: number) => any) {
loopStart: for (let x = 0; x < this.dim; x++) {
for (let y = 0; y < this.dim; y++) {
for (let z = 0; z < this.dim; z++) {
cb(this.at(x, y, z), x, y, z);
}
}
}
}
}