import { Mediator } from "../../src" ; import { RobotlegsView } from "../view/RobotlegsView" ; import { SmileyView } from "../view/SmileyView" ; export class RobotlegsMediator extends Mediator < RobotlegsView > { public initialize ( ) { console . log ( "CircleMediator initialized!" ) ; this . view . interactive = true ; this . addViewListener ( "click" , this . onClick , this ) ; } public onClick ( e ) { let radius = 50 + Math . random ( ) * 50 ; this . view . parent . addChild ( new SmileyView ( radius ) ) ; } public destroy ( ) { console . log ( "CircleMediator destroyed!" ) ; } }