
/*
* name;
*/
export class DataInfoBase extends Laya.EventDispatcher
{
    constructor(){
        super();
    }
    /***********混淆********* */
    showApe() {
		const 
			monkey1Path = "./res/apes/monkey1.png",
			monkey2Path = "./res/apes/monkey2.png";

		// 方法1：使用loadImage
		let ape = new Laya.Sprite();
		Laya.stage.addChild(ape);
		ape.loadImage(monkey1Path);

		// 方法2：使用drawTexture
		Laya.loader.load(monkey2Path, Laya.Handler.create(this, function() {
			let monkey2 = Laya.loader.getRes(monkey2Path);
			let ape2 = new Laya.Sprite();
			Laya.stage.addChild(ape2);
			ape2.graphics.drawTexture(monkey2, 100, 0);
		}));
    }
    /*********************** */
    

    public DataInfo( data:any ):void
    {
        if( data )
        {
            for( var s in data )
            {
                var itemd:any = this[s];
                if( itemd != null ) 
                {
                    this[s] = data[s];
                }
                // else
                // {
                //     Debuger.log( "VO:未定义属性-" + s );
                // }
            }
        }
    }

    /*********混淆 */
    private createButton(skin: string,name:string,cb:Function,index:number):Laya.Button {
        var btn:Laya.Button = new Laya.Button(skin,name);
       Laya.stage.addChild(btn);
        btn.on(Laya.Event.CLICK,this,cb);
        btn.size(147,55);
        btn.name = name;
        btn.right = 10;
        btn.top = index * (btn.height + 10);
		return btn;
    }
    /***************** */

    public dispatchEvent(type: string, data?: any):void
    {
        this.event(type, data);
    }

    
    
}