diff --git a/package/client/resource/points/index.ts b/package/client/resource/points/index.ts index b88c5ed..d36052e 100644 --- a/package/client/resource/points/index.ts +++ b/package/client/resource/points/index.ts @@ -6,32 +6,35 @@ let nearbyCount: number = 0; let closestPoint: Point | undefined; let tick: number | undefined; -interface LibPoint { +interface LibPoint { coords: number[]; distance: number; onEnter?: () => void; onExit?: () => void; nearby?: () => void; + args?: T; } -export class Point { +export class Point { id: number = 0; coords: Vector3; distance: number = 0; onEnter?: () => void; onExit?: () => void; nearby?: () => void; + args?: T; inside: boolean = false; currentDistance?: number; isClosest: boolean = false; - constructor(point: LibPoint) { + constructor(point: LibPoint) { this.id = points.length + 1; this.coords = Vector3.fromArray(point.coords); this.distance = point.distance; this.onEnter = point.onEnter; this.onExit = point.onExit; this.nearby = point.nearby; + this.args = point.args; points.push(this); }