Optimize transport trail processing and raster helpers

This commit is contained in:
scamiv
2026-03-16 00:52:10 +01:00
parent dccf980e02
commit dfc74e0cc2
4 changed files with 460 additions and 100 deletions
+11 -5
View File
@@ -7,9 +7,12 @@ describe("UnitLayer trail lifecycle helpers", () => {
[10, [1, 2, 3]],
[11, [4, 5]],
]);
const transportTrails = new Map<number, { xy: number[] }>([
[10, { xy: [1, 1, 2, 2] }],
[12, { xy: [5, 5, 6, 6] }],
const transportTrails = new Map<
number,
{ activePlanId: number; epochs: unknown[]; lastOnScreen: boolean }
>([
[10, { activePlanId: 1, epochs: [{}], lastOnScreen: true }],
[12, { activePlanId: 2, epochs: [{}], lastOnScreen: false }],
]);
const result = pruneInactiveTrails(
@@ -25,8 +28,11 @@ describe("UnitLayer trail lifecycle helpers", () => {
it("keeps all trails when units are active", () => {
const nukeTrails = new Map<number, number[]>([[1, [1]]]);
const transportTrails = new Map<number, { xy: number[] }>([
[2, { xy: [0, 0, 1, 1] }],
const transportTrails = new Map<
number,
{ activePlanId: number; epochs: unknown[]; lastOnScreen: boolean }
>([
[2, { activePlanId: 1, epochs: [{}], lastOnScreen: true }],
]);
const result = pruneInactiveTrails(