import { Inject , Singleton } from 'typescript-ioc' ; import { RendererComponent } from './renderer.component' ; import { TimerComponent } from '../timer/timer.component' ; import { WorldComponent } from '../world/world.component' ; import { CameraComponent } from '../camera/camera.component' ; import { CoreControllerComponent } from '../controller/core-controller.component' ; @ Singleton export class RendererManager { constructor ( @ Inject private readonly component , @ Inject private readonly world , @ Inject private readonly camera , @ Inject private readonly timer , @ Inject private readonly controller ) { timer . step$ . subscribe ( ( ) => component . render ( world . getWorlds ( ) , world . getCurrentWorld ( ) , camera . getCamera ( ) ) ) ; controller . resize$ . subscribe ( ( size ) => component . setSize ( size . x , size . y ) ) ; } }