pick and place editing working, saving and loading working

This commit is contained in:
2025-02-09 02:54:17 -07:00
parent 8dc0af650f
commit 3d4596f8fb
13 changed files with 879 additions and 309 deletions

View File

@@ -0,0 +1,35 @@
import { assert } from "jsr:@std/assert";
import { describe, it } from "jsr:@std/testing/bdd";
import { TrackSystem } from "../track/system.ts";
import { StraightTrack } from "../track/shapes.ts";
import { testPerformance } from "./bench.ts";
import { setDefaultContext } from "../lib/context.ts";
/**
* Tests if a function can run a given number of iterations within a target frame time.
* @param fn The function to test.
* @param iterations Number of times to run the function per frame.
* @param fps Target frames per second.
*/
Deno.test("Track System Benchmark", () => {
console.log("Track System Benchmark - run within frame time");
const mockDoodler = {
fillCircle: () => {},
line: () => {},
};
setDefaultContext({
doodler: mockDoodler,
});
const mockTrack = new TrackSystem([]);
for (let i = 0; i < 100; i++) {
mockTrack.registerSegment(new StraightTrack());
}
testPerformance(
() => {
mockTrack.findEnds();
},
10000,
60,
);
});