extend(Game, createjs.Container);

function Game()
{	
	this.initialize();
//--------------------------------//
	var _vmGame, _vmInterface, _visGame, _visInterface, _logic, _tutor
	var m = new createjs.Shape()
	m.graphics.beginFill("#000000").drawRect(0, 0, WIDTHGAME, HEIGHTGAME)
	// this.addChild(m)

	// this.mask = m

	
	this.update = function(par){
		if(par && par.dont_update){
			if(par.unPause)
				_vmInterface.pauseClick()
			return
		}
		st_setNumPlay(1)
		this.removeAllChildren()
		t_delAllInPause()
		t_delAllInTicker()
		tw_removeAllTweens()

		_logic = new LogicGame(par.size_field)
		_vmGame = new ViewModelGame(_logic)
		_vmInterface = new ViewModelInterface(_logic)
		var t = st_getNumPlay() == 1 ? true : false
		_logic.init(t)
		// _vmInterface.setTutorial(true)
		
		_visGame = _vmGame.getVisual()
		_tutor = _vmInterface.getTutorial()
		_visInterface = _vmInterface.getVisual()

		this.addChild(_visGame)
		this.addChild(_visInterface)
		this.addChild(_tutor)
	}
};