import { IndexedGeometry } from '../../../utils/geometry' ; internal export class IndexedGeometryLinearMap { private map = new Map < string | number , IndexedGeometry [ ] > ( ) ; get size ( ) { return this . map . size ; } set ( geometry ) { const { x } = geometry . value ; const existing = this . map . get ( x ) ; if ( existing === undefined ) { this . map . set ( x , [ geometry ] ) ; } else { this . map . set ( x , [ geometry , ... existing ] ) ; } } getMergeData ( ) { return [ ... this . map . values ( ) ] ; } keys ( ) { return [ ... this . map . keys ( ) ] ; } find ( x ) { if ( x === null ) { return [ ] ; } return this . map . get ( x ) ?? [ ] ; } }