import { Entity , IScene } from '@antv/g-webgpu-core' ; import { injectable } from 'inversify' ; import { Renderable } from '.' ; @ injectable ( ) export class Scene implements IScene { private entities : Entity [ ] = [ ] ; public getEntities ( ) { return this . entities ; } public addRenderable ( renderable ) { this . addEntity ( renderable . getEntity ( ) ) ; return this ; } public removeRenderable ( renderable ) { this . removeEntity ( renderable . getEntity ( ) ) ; return this ; } public addLight ( ) { } private addEntity ( entity ) { if ( this . entities . indexOf ( entity ) === - 1 ) { this . entities . push ( entity ) ; } return this ; } private removeEntity ( entity ) { const index = this . entities . indexOf ( entity ) ; this . entities . splice ( index , 1 ) ; return this ; } }