import { Container , DisplayObject } from "pixi.js" ; import { IClass } from "@robotlegsjs/core" ; import { ContainerBinding } from "./ContainerBinding" ; private export class StageCrawler { private _binding : ContainerBinding ; private constructor ( containerBinding ) { this . _binding = containerBinding ; } private public scan ( container ) { this . scanContainer ( container ) ; } private scanContainer ( container ) { this . processView ( container ) ; container . children . forEach ( child => { if ( child instanceof Container ) { this . scanContainer ( child ) ; } else { this . processView ( child ) ; } } ) ; } private processView ( view ) { this . _binding . handleView ( view , < IClass < any > > view . constructor ) ; } }