diff --git a/nexus/components/spatial-memory.js b/nexus/components/spatial-memory.js index 407fa030..3e024dc6 100644 --- a/nexus/components/spatial-memory.js +++ b/nexus/components/spatial-memory.js @@ -1,4 +1,41 @@ -// ═══════════════════════════════════════════ +// ═══ + // ─── REGION VISIBILITY (Memory Filter) ────────────── + let _regionVisibility = {}; // category -> boolean (undefined = visible) + + setRegionVisibility(category, visible) { + _regionVisibility[category] = visible; + for (const obj of Object.values(_memoryObjects)) { + if (obj.data.category === category && obj.mesh) { + obj.mesh.visible = visible !== false; + } + } + }, + + setAllRegionsVisible(visible) { + const cats = Object.keys(REGIONS); + for (const cat of cats) { + _regionVisibility[cat] = visible; + for (const obj of Object.values(_memoryObjects)) { + if (obj.data.category === cat && obj.mesh) { + obj.mesh.visible = visible; + } + } + } + }, + + getMemoryCountByRegion() { + const counts = {}; + for (const obj of Object.values(_memoryObjects)) { + const cat = obj.data.category || 'working'; + counts[cat] = (counts[cat] || 0) + 1; + } + return counts; + }, + + isRegionVisible(category) { + return _regionVisibility[category] !== false; + }, +════════════════════════════════════════ // PROJECT MNEMOSYNE — SPATIAL MEMORY SCHEMA // ═══════════════════════════════════════════ //