From 6d8c3cee4f936255f2959d11fa944d2a935e84bd Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Mon, 6 Jul 2026 20:11:43 +0530 Subject: [PATCH] feat: Implemented basic location graph --- packages/spatial/package.json | 3 +++ packages/spatial/src/index.ts | 2 +- packages/spatial/src/location.ts | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 packages/spatial/src/location.ts diff --git a/packages/spatial/package.json b/packages/spatial/package.json index a21e15c..2182235 100644 --- a/packages/spatial/package.json +++ b/packages/spatial/package.json @@ -5,5 +5,8 @@ "type": "module", "exports": { ".": "./dist/index.js" + }, + "dependencies": { + "@omnia/core": "workspace:*" } } diff --git a/packages/spatial/src/index.ts b/packages/spatial/src/index.ts index cb0ff5c..c62cb16 100644 --- a/packages/spatial/src/index.ts +++ b/packages/spatial/src/index.ts @@ -1 +1 @@ -export {}; +export * from "./location.js"; diff --git a/packages/spatial/src/location.ts b/packages/spatial/src/location.ts new file mode 100644 index 0000000..fad8afd --- /dev/null +++ b/packages/spatial/src/location.ts @@ -0,0 +1,20 @@ +import { AttributableObject } from "@omnia/core"; + +export class Location extends AttributableObject { + parentId: string | null; + connections: PortalConnection[] = []; + + constructor(id?: string, parentId: string | null = null) { + super(id); + this.parentId = parentId; + } +} + +export interface PortalConnection { + targetId: string; + portalName?: string; + portalStateDescriptor?: string; + visionProp: number; // 0–10 + soundProp: number; // 0–10 + bidirectional: boolean; +}