refactor(SceneMgr): inline scene initialization method
This commit is contained in:
@@ -20,12 +20,7 @@ class SceneMgr {
|
|||||||
log.info('Initialization of SceneMgr');
|
log.info('Initialization of SceneMgr');
|
||||||
|
|
||||||
// Initialize the scenes map by reducing the array of scenes into an object with unique IDs as keys.
|
// Initialize the scenes map by reducing the array of scenes into an object with unique IDs as keys.
|
||||||
this.scenes = this.initializeScenes();
|
this.scenes = this.getScenes().reduce((scenes, scene) => {
|
||||||
}
|
|
||||||
|
|
||||||
// Helper method to initialize scenes using reduce.
|
|
||||||
initializeScenes() {
|
|
||||||
return this.getScenes().reduce((scenes, scene) => {
|
|
||||||
const sceneUID = scene.getUID();
|
const sceneUID = scene.getUID();
|
||||||
scenes[sceneUID] = new Scene(scene);
|
scenes[sceneUID] = new Scene(scene);
|
||||||
return scenes;
|
return scenes;
|
||||||
|
|||||||
Reference in New Issue
Block a user