// import GameView from "./GameView";
import { injectProps } from "../props";

import TestView from './TestView'
import { Buried } from "./Buried";


export class GameWrapper extends engine.Container{
	// private _gameView:GameView
	
	private _testView:TestView

    constructor(){
        super();
        // engine.globalEvent.addEventListener('pictures-start', this.start, this);
        // engine.globalEvent.addEventListener('pictures-stop', this.stop, this);
        engine.globalEvent.addEventListener("pictures-setProjectId",this.setProjectId,this);

		//创建实例
		// let gameView = this._gameView = new GameView();
		// this.addChild(gameView);

		let testView = this._testView = new TestView();
		this.addChild(testView);
    }

    setProjectId(event:engine.Event){
        injectProps(event.data);
        Buried.oaId = event.data.projectId;
        Buried.appId = event.data.appId;
    }

	start(event: engine.Event) {
		injectProps(event.data);

		// this._status = 1;

		// this._testView.start();
	}
	stop(event: engine.Event) {
		// this._testView.stop();
	}
}