import { TreeElement } from "../classes/TreeElement" ; import { lazyInject } from "../inversify.config" ; import SceneStore from "../stores/SceneStore" ; import TreeService from "./TreeService" ; export default class SelectedElementService { @ lazyInject ( "TreeService" ) private readonly treeService ! : TreeService ; @ lazyInject ( "SceneStore" ) private readonly sceneStore ! : SceneStore ; public getSelectedElement ( ) { let selectedElement = null ; if ( this . sceneStore . projectData !== null && this . sceneStore . selectedObjectKey != null ) { selectedElement = this . treeService . searchTreeNode ( this . sceneStore . projectData , this . sceneStore . selectedObjectKey ) ; } return selectedElement ; } }