
import GameView from "./GameView";
import GameTest from "./GameTest";

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


export class GameWrapper extends engine.Container {
	// private _status;
	private _gameView: GameView;
	private _gameTest: GameTest;





	constructor() {
		super();

		engine.globalEvent.addEventListener('pictures-start', this.start, this);
		engine.globalEvent.addEventListener('pictures-stop', this.stop, this);

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

	}

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

		// this._status = 1;

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