Files
Construct-CN/packs/BP/scripts/classes/Verifier/GridBuffers.js
T
wed150 136d5ffa3b
/ build (push) Has been cancelled
Start working at 1.2.0
2026-08-26 09:54:39 +08:00

33 lines
659 B
JavaScript

import { VerificationGrid } from "./VerificationGrid";
export class GridBuffers {
#completed;
#filling;
completed() {
return this.#completed;
}
filling() {
return this.#filling;
}
beginPass(bounds) {
this.#filling = this.#recycled(this.#filling, bounds);
return this.#filling;
}
commit() {
const finished = this.#filling;
this.#filling = this.#completed;
this.#completed = finished;
}
#recycled(grid, bounds) {
if (!grid?.matchesBounds(bounds))
return new VerificationGrid(bounds);
grid.clear();
return grid;
}
}