/**
 * Created by rockyl on 2020-01-09.
 */

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


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

	constructor() {
		super();

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

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

	}

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

		
		// this._status = 1;

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