var egret;(function(c){var b=function(){function c(){this._hashCode=c.hashCount++}Object.defineProperty(c.prototype,"hashCode",{get:function(){return this._hashCode},enumerable:!0,configurable:!0});c.hashCount=1;return c}();c.HashObject=b;b.prototype.__class__="egret.HashObject"})(egret||(egret={}));var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(c){function a(e){"undefined"===typeof e&&(e=300);c.call(this);this.objectPool=[];this._length=0;1>e&&(e=1);this.autoDisposeTime=e;this.frameCount=0}__extends(a,c);a.prototype._checkFrame=function(){this.frameCount--;0>=this.frameCount&&this.dispose()};Object.defineProperty(a.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0});a.prototype.push=function(e){var c=this.objectPool;-1==c.indexOf(e)&&(c.push(e),this._length++,0==this.frameCount&& (this.frameCount=this.autoDisposeTime,a._callBackList.push(this)))};a.prototype.pop=function(){if(0==this._length)return null;this._length--;return this.objectPool.pop()};a.prototype.dispose=function(){0=this._maxDeltaTime){a=(this._preDrawCount-1).toString();var e=Math.ceil(this._logicPerformanceCost).toString()+","+Math.ceil(this._updateTransformPerformanceCost).toString()+","+Math.ceil(this._renderPerformanceCost).toString()+ ","+Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();this._txt.text="draw:"+a+"\ncost:"+e+"\nFPS:"+Math.floor(1E3*this._tick/this._totalDeltaTime).toString();this._tick=this._totalDeltaTime=0}this._preDrawCount=0};b.prototype.onDrawImage=function(){this._preDrawCount++};return b}();c.Profiler=b;b.prototype.__class__="egret.Profiler"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.apply(this,arguments);this._timeScale=1;this._paused=!1;this.callBackList=[]}__extends(a,b);a.prototype.run=function(){c.__START_TIME=(new Date).getTime();c.MainContext.instance.deviceContext.executeMainLoop(this.update,this)};a.prototype.update=function(e){var a=this.callBackList.concat(),c=a.length;e*=this._timeScale;e*=this._timeScale;for(var b=0;bthis.delay&&(this.lastTime=e,this._currentCount++,c.TimerEvent.dispatchTimerEvent(this,c.TimerEvent.TIMER),0=this.repeatCount&&(this.stop(),c.TimerEvent.dispatchTimerEvent(this,c.TimerEvent.TIMER_COMPLETE)))}; return a}(c.EventDispatcher);c.Timer=b;b.prototype.__class__="egret.Timer"})(egret||(egret={}));(function(c){c.getQualifiedClassName=function(c){c=c.prototype?c.prototype:c.__proto__;if(c.hasOwnProperty("__class__"))return c.__class__;var d=c.constructor.toString(),a=d.indexOf("("),d=d.substring(9,a);return c.__class__=d}})(egret||(egret={})); (function(c){var b={};c.getDefinitionByName=function(c){if(!c)return null;var a=b[c];if(a)return a;for(var e=c.split("."),l=e.length,a=__global,n=0;n=c.delay&&(c.listener.apply(c.thisObject,c.params),delete d[a])}}var d={},a=0;c.setTimeout=function(e,l,n){for(var g=[],f=0;fc)c=0;16777215c.length;)c="0"+c;return"#"+c}})(egret||(egret={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(e,a,c,g,f,h){"undefined"===typeof e&&(e=1);"undefined"===typeof a&&(a=0);"undefined"===typeof c&&(c=0);"undefined"===typeof g&&(g=1);"undefined"===typeof f&&(f=0);"undefined"===typeof h&&(h=0);b.call(this);this.a=e;this.b=a;this.c=c;this.d=g;this.tx=f;this.ty=h}__extends(a,b);a.prototype.prepend=function(e,a,c,b,d,h){var k=this.tx;if(1!=e||0!=a||0!=c||1!=b){var p=this.a,m=this.c;this.a=p*e+this.b*c;this.b=p*a+this.b*b;this.c=m*e+this.d*c;this.d=m*a+this.d* b}this.tx=k*e+this.ty*c+d;this.ty=k*a+this.ty*b+h;return this};a.prototype.append=function(e,a,c,b,d,h){var k=this.a,p=this.b,m=this.c,q=this.d;if(1!=e||0!=a||0!=c||1!=b)this.a=e*k+a*m,this.b=e*p+a*q,this.c=c*k+b*m,this.d=c*p+b*q;this.tx=d*k+h*m+this.tx;this.ty=d*p+h*q+this.ty;return this};a.prototype.prependMatrix=function(e){this.prepend(e.a,e.b,e.c,e.d,e.tx,e.ty);return this};a.prototype.appendMatrix=function(e){this.append(e.a,e.b,e.c,e.d,e.tx,e.ty);return this};a.prototype.prependTransform=function(e, c,b,d,f,h,k,p,m){if(f%360){var q=f*a.DEG_TO_RAD;f=Math.cos(q);q=Math.sin(q)}else f=1,q=0;if(p||m)this.tx-=p,this.ty-=m;h||k?(h*=a.DEG_TO_RAD,k*=a.DEG_TO_RAD,this.prepend(f*b,q*b,-q*d,f*d,0,0),this.prepend(Math.cos(k),Math.sin(k),-Math.sin(h),Math.cos(h),e,c)):this.prepend(f*b,q*b,-q*d,f*d,e,c);return this};a.prototype.appendTransform=function(e,c,b,d,f,h,k,p,m){if(f%360){var q=f*a.DEG_TO_RAD;f=Math.cos(q);q=Math.sin(q)}else f=1,q=0;h||k?(h*=a.DEG_TO_RAD,k*=a.DEG_TO_RAD,this.append(Math.cos(k),Math.sin(k), -Math.sin(h),Math.cos(h),e,c),this.append(f*b,q*b,-q*d,f*d,0,0)):this.append(f*b,q*b,-q*d,f*d,e,c);if(p||m)this.tx-=p*this.a+m*this.c,this.ty-=p*this.b+m*this.d;return this};a.prototype.rotate=function(e){var a=Math.cos(e);e=Math.sin(e);var c=this.a,b=this.c,d=this.tx;this.a=c*a-this.b*e;this.b=c*e+this.b*a;this.c=b*a-this.d*e;this.d=b*e+this.d*a;this.tx=d*a-this.ty*e;this.ty=d*e+this.ty*a;return this};a.prototype.skew=function(e,c){e*=a.DEG_TO_RAD;c*=a.DEG_TO_RAD;this.append(Math.cos(c),Math.sin(c), -Math.sin(e),Math.cos(e),0,0);return this};a.prototype.scale=function(e,a){this.a*=e;this.d*=a;this.c*=e;this.b*=a;this.tx*=e;this.ty*=a;return this};a.prototype.translate=function(e,a){this.tx+=e;this.ty+=a;return this};a.prototype.identity=function(){this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;return this};a.prototype.identityMatrix=function(e){this.a=e.a;this.b=e.b;this.c=e.c;this.d=e.d;this.tx=e.tx;this.ty=e.ty;return this};a.prototype.invert=function(){var e=this.a,a=this.b,c=this.c,b=this.d, d=this.tx,h=e*b-a*c;this.a=b/h;this.b=-a/h;this.c=-c/h;this.d=e/h;this.tx=(c*this.ty-b*d)/h;this.ty=-(e*this.ty-a*d)/h;return this};a.transformCoords=function(e,a,b){var d=c.Point.identity;d.x=e.a*a+e.c*b+e.tx;d.y=e.d*b+e.b*a+e.ty;return d};a.prototype.toArray=function(e){this.array||(this.array=new Float32Array(9));e?(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=0,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=0,this.array[6]=this.tx,this.array[7]=this.ty):(this.array[0]=this.a, this.array[1]=this.b,this.array[2]=this.tx,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=this.ty,this.array[6]=0,this.array[7]=0);this.array[8]=1;return this.array};a.identity=new a;a.DEG_TO_RAD=Math.PI/180;return a}(c.HashObject);c.Matrix=b;b.prototype.__class__="egret.Matrix"})(egret||(egret={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(c){function a(e,a){"undefined"===typeof e&&(e=0);"undefined"===typeof a&&(a=0);c.call(this);this.x=e;this.y=a}__extends(a,c);a.prototype.clone=function(){return new a(this.x,this.y)};a.prototype.equals=function(e){return this.x==e.x&&this.y==e.y};a.distance=function(e,a){return Math.sqrt((e.x-a.x)*(e.x-a.x)+(e.y-a.y)*(e.y-a.y))};a.identity=new a(0,0);return a}(c.HashObject);c.Point=b;b.prototype.__class__="egret.Point"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(c){function a(e,a,b,g){"undefined"===typeof e&&(e=0);"undefined"===typeof a&&(a=0);"undefined"===typeof b&&(b=0);"undefined"===typeof g&&(g=0);c.call(this);this.x=e;this.y=a;this.width=b;this.height=g}__extends(a,c);Object.defineProperty(a.prototype,"right",{get:function(){return this.x+this.width},set:function(e){this.width=e-this.x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"bottom",{get:function(){return this.y+this.height},set:function(e){this.height= e-this.y},enumerable:!0,configurable:!0});a.prototype.initialize=function(e,a,c,b){this.x=e;this.y=a;this.width=c;this.height=b;return this};a.prototype.contains=function(e,a){return this.x<=e&&this.x+this.width>=e&&this.y<=a&&this.y+this.height>=a};a.prototype.intersects=function(e){var a=e.right,c=e.bottom,b=this.right,d=this.bottom;return this.contains(e.x,e.y)||this.contains(e.x,c)||this.contains(a,e.y)||this.contains(a,c)||e.contains(this.x,this.y)||e.contains(this.x,d)||e.contains(b,this.y)|| e.contains(b,d)?!0:!1};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height)};a.prototype.containsPoint=function(e){return this.xe.x&&this.ye.y?!0:!1};a.identity=new a(0,0,0,0);return a}(c.HashObject);c.Rectangle=b;b.prototype.__class__="egret.Rectangle"})(egret||(egret={})); (function(c){var b=function(){function b(){}b.fatal=function(a,e){"undefined"===typeof e&&(e=null);c.Logger.traceToConsole("Fatal",a,e);throw Error(c.Logger.getTraceCode("Fatal",a,e));};b.info=function(a,e){"undefined"===typeof e&&(e=null);c.Logger.traceToConsole("Info",a,e)};b.warning=function(a,e){"undefined"===typeof e&&(e=null);c.Logger.traceToConsole("Warning",a,e)};b.traceToConsole=function(a,e,b){console.log(c.Logger.getTraceCode(a,e,b))};b.getTraceCode=function(a,e,c){return"["+a+"]"+e+":"+ (null==c?"":c)};return b}();c.Logger=b;b.prototype.__class__="egret.Logger"})(egret||(egret={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this);this._isSupportDOMParser=this._xmlDict=this._parser=null;this._xmlDict={};window.DOMParser?(this._isSupportDOMParser=!0,this._parser=new DOMParser):this._isSupportDOMParser=!1}__extends(a,b);a.getInstance=function(){a._instance||(a._instance=new a);return a._instance};a.prototype.parserXML=function(e){for(var a=0;"\n"==e.charAt(a)||"\t"==e.charAt(a)||"\r"==e.charAt(a)||" "==e.charAt(a);)a++;0!=a&&(e=e.substring(a,e.length));this._isSupportDOMParser? a=this._parser.parseFromString(e,"text/xml"):(a=new ActiveXObject("Microsoft.XMLDOM"),a.async="false",a.loadXML(e));null==a&&c.Logger.info("xml not found!");return a};a._instance=null;return a}(c.HashObject);c.SAXParser=b;b.prototype.__class__="egret.SAXParser"})(egret||(egret={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(e){function b(){e.call(this);this._designHeight=this._designWidth=0;this._scaleY=this._scaleX=1;this._stageHeight=this._stageWidth=this._offSetY=0}__extends(b,e);b.getInstance=function(){null==b.instance&&(a.initialize(),b.instance=new b);return b.instance};b.prototype.setDesignSize=function(e,a,b){this._designWidth=e;this._designHeight=a;b&&(c.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"), this._setResolutionPolicy(b))};b.prototype._setResolutionPolicy=function(e){this._resolutionPolicy=e;e.init(this);e._apply(this,this._designWidth,this._designHeight)};b.prototype.getScaleX=function(){return this._scaleX};b.prototype.getScaleY=function(){return this._scaleY};b.prototype.getOffSetY=function(){return this._offSetY};b.canvas_name="egretCanvas";b.canvas_div_name="gameDiv";return b}(c.HashObject);c.StageDelegate=b;b.prototype.__class__="egret.StageDelegate";var d=function(){function e(a, c){this._containerStrategy=a;this._contentStrategy=c}e.prototype.init=function(e){this._containerStrategy.init(e);this._contentStrategy.init(e)};e.prototype._apply=function(e,a,c){this._containerStrategy._apply(e,a,c);this._contentStrategy._apply(e,a,c)};return e}();c.ResolutionPolicy=d;d.prototype.__class__="egret.ResolutionPolicy";var a=function(){function a(){}a.initialize=function(){a.EQUAL_TO_FRAME=new e};a.prototype.init=function(e){};a.prototype._apply=function(e,a,c){};a.prototype._setupContainer= function(){var e=document.body,a;e&&(a=e.style)&&(a.paddingTop=a.paddingTop||"0px",a.paddingRight=a.paddingRight||"0px",a.paddingBottom=a.paddingBottom||"0px",a.paddingLeft=a.paddingLeft||"0px",a.borderTop=a.borderTop||"0px",a.borderRight=a.borderRight||"0px",a.borderBottom=a.borderBottom||"0px",a.borderLeft=a.borderLeft||"0px",a.marginTop=a.marginTop||"0px",a.marginRight=a.marginRight||"0px",a.marginBottom=a.marginBottom||"0px",a.marginLeft=a.marginLeft||"0px")};return a}();c.ContainerStrategy=a; a.prototype.__class__="egret.ContainerStrategy";var e=function(e){function a(){e.apply(this,arguments)}__extends(a,e);a.prototype._apply=function(e){this._setupContainer()};return a}(a);c.EqualToFrame=e;e.prototype.__class__="egret.EqualToFrame";d=function(){function e(){}e.prototype.init=function(e){};e.prototype._apply=function(e,a,c){};e.prototype.setEgretSize=function(e,a,d,l,n){"undefined"===typeof n&&(n=0);c.StageDelegate.getInstance()._stageWidth=e;c.StageDelegate.getInstance()._stageHeight= a;e=document.getElementById(b.canvas_div_name);e.style.width=d+"px";e.style.height=l+"px";e.style.top=n+"px"};return e}();c.ContentStrategy=d;d.prototype.__class__="egret.ContentStrategy";var l=function(e){function a(c){"undefined"===typeof c&&(c=0);e.call(this);this.minWidth=c}__extends(a,e);a.prototype._apply=function(e,a,c){a=document.documentElement.clientWidth;var b=document.documentElement.clientHeight,d=b/c,l=a/d,n=1;0!=this.minWidth&&(n=Math.min(1,l/this.minWidth));this.setEgretSize(l/n,c, a,b*n);e._scaleX=d*n;e._scaleY=d*n};return a}(d);c.FixedHeight=l;l.prototype.__class__="egret.FixedHeight";l=function(e){function a(c){"undefined"===typeof c&&(c=0);e.call(this);this.minHeight=c}__extends(a,e);a.prototype._apply=function(e,a,c){c=document.documentElement.clientWidth;var b=document.documentElement.clientHeight,d=c/a,l=b/d,n=1;0!=this.minHeight&&(n=Math.min(1,l/this.minHeight));this.setEgretSize(a,l/n,c*n,b);e._scaleX=d*n;e._scaleY=d*n};return a}(d);c.FixedWidth=l;l.prototype.__class__= "egret.FixedWidth";l=function(e){function a(c,b){e.call(this);this.width=c;this.height=b}__extends(a,e);a.prototype._apply=function(e,a,c){c=this.width;var b=this.height,d=c/a;this.setEgretSize(a,b/d,c,b);e._scaleX=d;e._scaleY=d};return a}(d);c.FixedSize=l;l.prototype.__class__="egret.FixedSize";l=function(e){function a(){e.call(this)}__extends(a,e);a.prototype._apply=function(e,a,c){this.setEgretSize(a,c,a,c);e._scaleX=1;e._scaleY=1};return a}(d);c.NoScale=l;l.prototype.__class__="egret.NoScale"; l=function(e){function a(){e.call(this)}__extends(a,e);a.prototype._apply=function(e,a,c){var b=document.documentElement.clientWidth,d=document.documentElement.clientHeight,b=b/av.x+v.width||a._worldBounds.y+a._worldBounds.height+r.destY>v.y+v.height){c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df"); break}}else{var x=a._worldTransform.a,y=a._worldTransform.d,w;a._worldBounds.x+r.destXv.x+v.width&&(w=(a._worldBounds.x+a._worldBounds.width-v.x-v.width)/x+r.destX,f-=w/(m/f),m-=w);a._worldBounds.y+a._worldBounds.height+r.destY>v.y+v.height&&(w=(a._worldBounds.y+a._worldBounds.height- v.y-v.height)/y+r.destY,h-=w/(q/h),q-=w)}e.drawImage(s,b,d,f,h,k,p,m,q)}}}else e.drawImage(s,b,d,f,h,k,p,m,q)};a.prototype.ignoreRender=function(e,a,c,b){var d=e._worldBounds;c*=e._worldTransform.a;b*=e._worldTransform.d;return d.x+d.width+c<=a.x||d.x+c>=a.x+a.width||d.y+d.height+b<=a.y||d.y+b>=a.y+a.height?!0:!1};a.prototype.getDrawAreaList=function(){var e;0==this._drawAreaList.length?(this._defaultDrawAreaList||(this._defaultDrawAreaList=[new c.Rectangle(0,0,c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)]),e=this._defaultDrawAreaList):e=this._drawAreaList;return e};return a}(c.HashObject);c.RenderFilter=b;b.prototype.__class__="egret.RenderFilter"})(egret||(egret={})); (function(c){var b=function(){function b(){}b.mapClass=function(a,e,c){"undefined"===typeof c&&(c="");a=this.getKey(a)+"#"+c;this.mapClassDic[a]=e};b.getKey=function(a){return"string"==typeof a?a:c.getQualifiedClassName(a)};b.mapValue=function(a,e,c){"undefined"===typeof c&&(c="");a=this.getKey(a)+"#"+c;this.mapValueDic[a]=e};b.hasMapRule=function(a,e){"undefined"===typeof e&&(e="");var c=this.getKey(a)+"#"+e;return this.mapValueDic[c]||this.mapClassDic[c]?!0:!1};b.getInstance=function(a,e){"undefined"=== typeof e&&(e="");var c=this.getKey(a)+"#"+e;if(this.mapValueDic[c])return this.mapValueDic[c];var b=this.mapClassDic[c];if(b)return b=new b,this.mapValueDic[c]=b,delete this.mapClassDic[c],b;throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:"+c+"\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");};b.mapClassDic={};b.mapValueDic={};return b}();c.Injector= b;b.prototype.__class__="egret.Injector"})(egret||(egret={}));(function(c){var b=function(){function c(){}c.NORMAL="normal";c.ADD="add";c.LAYER="layer";return c}();c.BlendMode=b;b.prototype.__class__="egret.BlendMode"})(egret||(egret={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this);this._sizeDirty=this._normalDirty=!0;this._parent=null;this._cacheAsBitmap=!1;this._y=this._x=0;this._scaleY=this._scaleX=1;this._anchorY=this._anchorX=this._anchorOffsetY=this._anchorOffsetX=0;this._visible=!0;this._rotation=0;this._alpha=1;this._skewY=this._skewX=0;this._hasHeightSet=this._hasWidthSet=!1;this.worldAlpha=1;this._rectH=this._rectW=0;this._stage=null;this._worldTransform=new c.Matrix;this._cacheBounds=new c.Rectangle(0,0,0,0)} __extends(a,b);a.prototype._setDirty=function(){this._normalDirty=!0};a.prototype.getDirty=function(){return this._normalDirty||this._sizeDirty};a.prototype._setParentSizeDirty=function(){var e=this._parent;!e||e._hasWidthSet||e._hasHeightSet||e._setSizeDirty()};a.prototype._setSizeDirty=function(){this._sizeDirty||(this._sizeDirty=!0,this._setDirty(),this._setParentSizeDirty())};a.prototype._clearDirty=function(){this._normalDirty=!1};a.prototype._clearSizeDirty=function(){this._sizeDirty=!1};Object.defineProperty(a.prototype, "parent",{get:function(){return this._parent},enumerable:!0,configurable:!0});a.prototype._parentChanged=function(e){this._parent=e};Object.defineProperty(a.prototype,"x",{get:function(){return this._x},set:function(e){this._setX(e)},enumerable:!0,configurable:!0});a.prototype._setX=function(e){c.NumberUtils.isNumber(e)&&this._x!=e&&(this._x=e,this._setDirty(),this._setParentSizeDirty())};Object.defineProperty(a.prototype,"y",{get:function(){return this._y},set:function(e){this._setY(e)},enumerable:!0, configurable:!0});a.prototype._setY=function(e){c.NumberUtils.isNumber(e)&&this._y!=e&&(this._y=e,this._setDirty(),this._setParentSizeDirty())};Object.defineProperty(a.prototype,"scaleX",{get:function(){return this._scaleX},set:function(e){c.NumberUtils.isNumber(e)&&this._scaleX!=e&&(this._scaleX=e,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scaleY",{get:function(){return this._scaleY},set:function(e){c.NumberUtils.isNumber(e)&& this._scaleY!=e&&(this._scaleY=e,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorOffsetX",{get:function(){return this._anchorOffsetX},set:function(e){c.NumberUtils.isNumber(e)&&this._anchorOffsetX!=e&&(this._anchorOffsetX=e,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorOffsetY",{get:function(){return this._anchorOffsetY},set:function(e){c.NumberUtils.isNumber(e)&& this._anchorOffsetY!=e&&(this._anchorOffsetY=e,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorX",{get:function(){return this._anchorX},set:function(e){c.NumberUtils.isNumber(e)&&this._anchorX!=e&&(this._anchorX=e,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"anchorY",{get:function(){return this._anchorY},set:function(e){c.NumberUtils.isNumber(e)&&this._anchorY!= e&&(this._anchorY=e,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"visible",{get:function(){return this._visible},set:function(e){this._setVisible(e)},enumerable:!0,configurable:!0});a.prototype._setVisible=function(e){this._visible!=e&&(this._visible=e,this._setSizeDirty())};Object.defineProperty(a.prototype,"rotation",{get:function(){return this._rotation},set:function(e){c.NumberUtils.isNumber(e)&&this._rotation!=e&&(this._rotation= e,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"alpha",{get:function(){return this._alpha},set:function(e){c.NumberUtils.isNumber(e)&&this._alpha!=e&&(this._alpha=e,this._setDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"skewX",{get:function(){return this._skewX},set:function(e){c.NumberUtils.isNumber(e)&&this._skewX!=e&&(this._skewX=e,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype, "skewY",{get:function(){return this._skewY},set:function(e){c.NumberUtils.isNumber(e)&&this._skewY!=e&&(this._skewY=e,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(e){this._touchEnabled=e},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(e){this._scrollRect=e;this._setSizeDirty()},enumerable:!0,configurable:!0}); Object.defineProperty(a.prototype,"measuredWidth",{get:function(){return this._measureBounds().width},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"measuredHeight",{get:function(){return this._measureBounds().height},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"explicitWidth",{get:function(){return this._explicitWidth},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"explicitHeight",{get:function(){return this._explicitHeight},enumerable:!0, configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._getSize(c.Rectangle.identity).width},set:function(e){this._setWidth(e)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"height",{get:function(){return this._getSize(c.Rectangle.identity).height},set:function(e){this._setHeight(e)},enumerable:!0,configurable:!0});a.prototype._setWidth=function(e){this._setSizeDirty();this._explicitWidth=e;this._hasWidthSet=c.NumberUtils.isNumber(e)};a.prototype._setHeight= function(e){this._setSizeDirty();this._explicitHeight=e;this._hasHeightSet=c.NumberUtils.isNumber(e)};a.prototype._draw=function(e){if(this._visible&&!this.drawCacheTexture(e)){e.setAlpha(this.worldAlpha,this.blendMode);e.setTransform(this._worldTransform);var a=this.mask||this._scrollRect;a&&e.pushMask(a);this._render(e);a&&e.popMask()}this.destroyCacheBounds()};a.prototype.drawCacheTexture=function(e){if(this._cacheAsBitmap){var a=this._texture_to_render,b=a._offsetX,d=a._offsetY,f=a._textureWidth, a=a._textureHeight;this._updateTransform();e.setAlpha(this.worldAlpha,this.blendMode);e.setTransform(this._worldTransform);var h=c.MainContext.instance.rendererContext.texture_scale_factor;c.RenderFilter.getInstance().drawImage(e,this,0,0,f*h,a*h,b,d,f,a);return!0}return!1};a.prototype._updateTransform=function(){this._calculateWorldform()};a.prototype._calculateWorldform=function(){this._worldTransform.identityMatrix(this._parent._worldTransform);var e=this._getOffsetPoint();this._worldTransform.appendTransform(this._x, this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,e.x,e.y);this._scrollRect&&this._worldTransform.append(1,0,0,1,-this._scrollRect.x,-this._scrollRect.y);this.worldAlpha=this._parent.worldAlpha*this._alpha};a.prototype._render=function(e){};a.prototype.getBounds=function(e){var a=this._measureBounds(),b=this._hasWidthSet?this._explicitWidth:a.width,d=this._hasHeightSet?this._explicitHeight:a.height,f=a.x,a=a.y,h,k;0!=this._anchorX||0!=this._anchorY?(h=b*this._anchorX,k=d*this._anchorY): (h=this._anchorOffsetX,k=this._anchorOffsetY);this._cacheBounds.initialize(f-h,a-k,b,d);b=this._cacheBounds;e||(e=new c.Rectangle);return e.initialize(b.x,b.y,b.width,b.height)};a.prototype.destroyCacheBounds=function(){this._cacheBounds.x=0;this._cacheBounds.y=0;this._cacheBounds.width=0;this._cacheBounds.height=0};a.prototype._getConcatenatedMatrix=function(){for(var e=a.identityMatrixForGetConcatenated.identity(),b=this;null!=b;){if(0!=b._anchorX||0!=b._anchorY){var d=b._getSize(c.Rectangle.identity); e.prependTransform(b._x,b._y,b._scaleX,b._scaleY,b._rotation,b._skewX,b._skewY,d.width*b._anchorX,d.height*b._anchorY)}else e.prependTransform(b._x,b._y,b._scaleX,b._scaleY,b._rotation,b._skewX,b._skewY,b._anchorOffsetX,b._anchorOffsetY);b=b._parent}return e};a.prototype.localToGlobal=function(e,a,b){"undefined"===typeof e&&(e=0);"undefined"===typeof a&&(a=0);var d=this._getConcatenatedMatrix();d.append(1,0,0,1,e,a);b||(b=new c.Point);b.x=d.tx;b.y=d.ty;return b};a.prototype.globalToLocal=function(a, b,d){"undefined"===typeof a&&(a=0);"undefined"===typeof b&&(b=0);var g=this._getConcatenatedMatrix();g.invert();g.append(1,0,0,1,a,b);d||(d=new c.Point);d.x=g.tx;d.y=g.ty;return d};a.prototype.hitTest=function(a,b,d){"undefined"===typeof d&&(d=!1);if(!this._visible||!d&&!this._touchEnabled)return null;d=this._getSize(c.Rectangle.identity);return 0<=a&&ar&&(r=b);(b=k+p+m)r&&(r=b);(b=p+m)r&&(r=b);(d=f+q)u&&(u=d);(d=f+h+q)u&&(u=d);(d=h+q)u&&(u=d);return a.initialize(s,t,r-s,u-t)};a.identityMatrixForGetConcatenated=new c.Matrix;a._enterFrameCallBackList=[];a._renderCallBackList=[];return a}(c.EventDispatcher);c.DisplayObject=b;b.prototype.__class__="egret.DisplayObject"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this);this._touchChildren=!0;this._children=[]}__extends(a,b);Object.defineProperty(a.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(a){this._touchChildren=a},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0});a.prototype.setChildIndex=function(a,c){this.doSetChildIndex(a,c)};a.prototype.doSetChildIndex=function(a, b){var d=this._children.indexOf(a);0>d&&c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");this._children.splice(d,1);0>b||this._children.length<=b?this._children.push(a):this._children.splice(b,0,a)};a.prototype.addChild=function(a){var c=this._children.length;a._parent==this&&c--;return this._doAddChild(a,c)};a.prototype.addChildAt=function(a,c){return this._doAddChild(a,c)};a.prototype._doAddChild=function(e,b,d){"undefined"===typeof d&&(d=!0);if(e==this)return e;if(0>b||b>this._children.length)return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"), e;var g=e._parent;if(g==this)return this.doSetChildIndex(e,b),e;g&&g.removeChild(e);this._children.splice(b,0,e);e._parentChanged(this);d&&e.dispatchEventWith(c.Event.ADDED,!0);if(this._stage)for(e._onAddToStage(),b=a.__EVENT__ADD_TO_STAGE_LIST;0b||0==h)b=q;if(mg||0==h)g=s}}return c.Rectangle.identity.initialize(a,d,b-a,g-d)};a.prototype.hitTest=function(a,l,n){"undefined"===typeof n&&(n=!1);var g;if(!this._visible)return null;if(this._scrollRect){if(0>a||0>l||a>this._scrollRect.width||l>this._scrollRect.height)return null}else if(this.mask&&(this.mask.x>a||a>this.mask.x+this.mask.width||this.mask.y>l||l>this.mask.y+this.mask.height))return null;for(var f=this._children, h=this._touchChildren,k=f.length-1;0<=k;k--){var p=f[k],m=p,q=m._getOffsetPoint(),s=m._x,r=m._y;this._scrollRect&&(s-=this._scrollRect.x,r-=this._scrollRect.y);m=c.Matrix.identity.identity().prependTransform(s,r,m._scaleX,m._scaleY,m._rotation,0,0,q.x,q.y);m.invert();m=c.Matrix.transformCoords(m,a,l);if(p=p.hitTest(m.x,m.y,!0)){if(!h)return this;if(p._touchEnabled&&h)return p;g=this}}return g?g:this._texture_to_render||this.graphics?b.prototype.hitTest.call(this,a,l,n):null};a.prototype._onAddToStage= function(){b.prototype._onAddToStage.call(this);for(var a=this._children.length,c=0;cb&&(b=k+h._textureHeight)}}this._textChanged=!1;return c.Rectangle.identity.initialize(0,0,a,b)};a.prototype._measureBounds= function(){return this._renderText(!0)};return a}(c.DisplayObjectContainer);c.BitmapText=b;b.prototype.__class__="egret.BitmapText"})(egret||(egret={})); (function(c){var b=function(){function c(){this._lastY=this._lastX=this._maxY=this._maxX=this._minY=this._minX=0;this.commandQueue=[]}c.prototype.beginFill=function(a,e){};c.prototype._setStyle=function(a){};c.prototype.drawRect=function(a,e,c,b){this.checkRect(a,e,c,b)};c.prototype.drawCircle=function(a,e,c){this.checkRect(a-c,e-c,2*c,2*c)};c.prototype.drawRoundRect=function(a,e,c,b,d,f){this.checkRect(a,e,c,b)};c.prototype.drawEllipse=function(a,e,c,b){this.checkRect(a-c,e-b,2*c,2*b)};c.prototype.lineStyle= function(a,e,c,b,d,f,h,k){};c.prototype.lineTo=function(a,e){this.checkPoint(a,e)};c.prototype.curveTo=function(a,e,c,b){this.checkPoint(a,e);this.checkPoint(c,b)};c.prototype.moveTo=function(a,e){this.checkPoint(a,e)};c.prototype.clear=function(){this._maxY=this._maxX=this._minY=this._minX=0};c.prototype.endFill=function(){};c.prototype._draw=function(a){};c.prototype.checkRect=function(a,e,c,b){this._minX=Math.min(this._minX,a);this._minY=Math.min(this._minY,e);this._maxX=Math.max(this._maxX,a+ c);this._maxY=Math.max(this._maxY,e+b)};c.prototype.checkPoint=function(a,e){this._minX=Math.min(this._minX,a);this._minY=Math.min(this._minY,e);this._maxX=Math.max(this._maxX,a);this._maxY=Math.max(this._maxY,e);this._lastX=a;this._lastY=e};return c}();c.Graphics=b;b.prototype.__class__="egret.Graphics";(function(){return function(c,a,e){this.method=c;this.thisObject=a;this.args=e}})().prototype.__class__="Command"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this)}__extends(a,b);Object.defineProperty(a.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new c.Graphics);return this._graphics},enumerable:!0,configurable:!0});a.prototype._render=function(a){this._graphics&&this._graphics._draw(a)};return a}(c.DisplayObject);c.Shape=b;b.prototype.__class__="egret.Shape"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this)}__extends(a,b);Object.defineProperty(a.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new c.Graphics);return this._graphics},enumerable:!0,configurable:!0});a.prototype._render=function(a){this._graphics&&this._graphics._draw(a);b.prototype._render.call(this,a)};return a}(c.DisplayObjectContainer);c.Sprite=b;b.prototype.__class__="egret.Sprite"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this);this._fontFamily="Arial";this._size=30;this._textColorString="#FFFFFF";this._textColor=16777215;this._strokeColorString="#000000";this._stroke=this._strokeColor=0;this._textAlign="left";this._verticalAlign="top";this._numLines=this._lineSpacing=0;this.measuredWidths=[]}__extends(a,b);Object.defineProperty(a.prototype,"text",{get:function(){return this._text},set:function(a){this._setText(a)},enumerable:!0,configurable:!0});a.prototype._setTextDirty= function(){this._setSizeDirty()};a.prototype._setText=function(a){this._text!=a&&(this._setTextDirty(),this._text=a)};Object.defineProperty(a.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(a){this._setFontFamily(a)},enumerable:!0,configurable:!0});a.prototype._setFontFamily=function(a){this._fontFamily!=a&&(this._setTextDirty(),this._fontFamily=a)};Object.defineProperty(a.prototype,"size",{get:function(){return this._size},set:function(a){this._setSize(a)},enumerable:!0, configurable:!0});a.prototype._setSize=function(a){this._size!=a&&(this._setTextDirty(),this._size=a)};Object.defineProperty(a.prototype,"italic",{get:function(){return this._italic},set:function(a){this._setItalic(a)},enumerable:!0,configurable:!0});a.prototype._setItalic=function(a){this._italic!=a&&(this._setTextDirty(),this._italic=a)};Object.defineProperty(a.prototype,"bold",{get:function(){return this._bold},set:function(a){this._setBold(a)},enumerable:!0,configurable:!0});a.prototype._setBold= function(a){this._bold!=a&&(this._setTextDirty(),this._bold=a)};Object.defineProperty(a.prototype,"textColor",{get:function(){return this._textColor},set:function(a){this._setTextColor(a)},enumerable:!0,configurable:!0});a.prototype._setTextColor=function(a){this._textColor!=a&&(this._setTextDirty(),this._textColor=a,this._textColorString=c.toColorString(a))};Object.defineProperty(a.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(a){this._setStrokeColor(a)},enumerable:!0, configurable:!0});a.prototype._setStrokeColor=function(a){this._strokeColor!=a&&(this._setTextDirty(),this._strokeColor=a,this._strokeColorString=c.toColorString(a))};Object.defineProperty(a.prototype,"stroke",{get:function(){return this._stroke},set:function(a){this._setStroke(a)},enumerable:!0,configurable:!0});a.prototype._setStroke=function(a){this._stroke!=a&&(this._setTextDirty(),this._stroke=a)};Object.defineProperty(a.prototype,"textAlign",{get:function(){return this._textAlign},set:function(a){this._setTextAlign(a)}, enumerable:!0,configurable:!0});a.prototype._setTextAlign=function(a){this._textAlign!=a&&(this._setTextDirty(),this._textAlign=a)};Object.defineProperty(a.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(a){this._setVerticalAlign(a)},enumerable:!0,configurable:!0});a.prototype._setVerticalAlign=function(a){this._verticalAlign!=a&&(this._setTextDirty(),this._verticalAlign=a)};Object.defineProperty(a.prototype,"lineSpacing",{get:function(){return this._lineSpacing}, set:function(a){this._setLineSpacing(a)},enumerable:!0,configurable:!0});a.prototype._setLineSpacing=function(a){this._lineSpacing!=a&&(this._setTextDirty(),this._lineSpacing=a)};Object.defineProperty(a.prototype,"numLines",{get:function(){return this._numLines},enumerable:!0,configurable:!0});a.prototype._render=function(a){this.drawText(a,!1);this._clearDirty()};a.prototype._measureBounds=function(){return this.drawText(c.MainContext.instance.rendererContext,!0)};a.prototype.drawText=function(a, b){var d=this.getTextLines(a);if(!d)return c.Rectangle.identity.initialize(0,0,0,0);var g=d.length,f=0.5*this._size,h=this._size+this._lineSpacing,k=g*h-this._lineSpacing;this._textHeight=k;var p=this._hasHeightSet?this._explicitHeight:Number.POSITIVE_INFINITY;if(this._hasHeightSet&&kh){for(var q="",s=0,r=p.length,t=0;th&&(0==s?(c.splice(k,0,u),b[k]=m,fthis.maxlength){a=a+255&-256;var c=new ArrayBuffer(a),b=new Uint8Array(this.arraybytes,0,this.length);(new Uint8Array(c,0,this.length)).set(b);this.arraybytes=c;this.maxlength=a}};a.prototype.writeByte=function(a){this.ensureWriteableSpace(1);(new Int8Array(this.arraybytes))[this.position++]=~~a;this.position>this.length&&(this.length=this.position)};a.prototype.readByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+ this.position+", Length="+this.length;return(new Int8Array(this.arraybytes))[this.position++]};a.prototype.readBytes=function(a,c,b){"undefined"===typeof c&&(c=0);"undefined"===typeof b&&(b=0);null==b&&(b=a.length);a.ensureWriteableSpace(c+b);var d=new Int8Array(a.arraybytes),f=new Int8Array(this.arraybytes);d.set(f.subarray(this.position,this.position+b),c);this.position+=b;b+c>a.length&&(a.length+=b+c-a.length)};a.prototype.writeUnsignedByte=function(a){this.ensureWriteableSpace(1);(new Uint8Array(this.arraybytes))[this.position++]= ~~a&255;this.position>this.length&&(this.length=this.position)};a.prototype.readUnsignedByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;return(new Uint8Array(this.arraybytes))[this.position++]};a.prototype.writeUnsignedShort=function(a){this.ensureWriteableSpace(2);if(0==(this.position&1)){var c=new Uint16Array(this.arraybytes);c[this.position>>1]=~~a&65535}else c=new Uint16Array(this.unalignedarraybytestemp,0,1),c[0]= ~~a&65535,a=new Uint8Array(this.arraybytes,this.position,2),c=new Uint8Array(this.unalignedarraybytestemp,0,2),a.set(c);this.position+=2;this.position>this.length&&(this.length=this.position)};a.prototype.readUTFBytes=function(a){var c="";a=this.position+a;for(var b=new DataView(this.arraybytes);this.positiond){if(0==d)break;c+=String.fromCharCode(d)}else if(224>d)c+=String.fromCharCode((d&63)<<6|b.getUint8(this.position++)&127);else if(240>d)var f=b.getUint8(this.position++), c=c+String.fromCharCode((d&31)<<12|(f&127)<<6|b.getUint8(this.position++)&127);else var f=b.getUint8(this.position++),h=b.getUint8(this.position++),c=c+String.fromCharCode((d&15)<<18|(f&127)<<12|h<<6&127|b.getUint8(this.position++)&127)}return c};a.prototype.readInt=function(){var a=(new DataView(this.arraybytes)).getInt32(this.position,this.isLittleEndian);this.position+=4;return a};a.prototype.readShort=function(){var a=(new DataView(this.arraybytes)).getInt16(this.position,this.isLittleEndian); this.position+=2;return a};a.prototype.readDouble=function(){var a=(new DataView(this.arraybytes)).getFloat64(this.position,this.isLittleEndian);this.position+=8;return a};a.prototype.readUnsignedShort=function(){if(this.position>this.length+2)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(this.position&1)){var a=new Uint16Array(this.arraybytes),c=this.position>>1;this.position+=2;return a[c]}a=new Uint16Array(this.unalignedarraybytestemp,0,1);c=new Uint8Array(this.arraybytes, this.position,2);(new Uint8Array(this.unalignedarraybytestemp,0,2)).set(c);this.position+=2;return a[0]};a.prototype.writeUnsignedInt=function(a){this.ensureWriteableSpace(4);if(0==(this.position&3)){var c=new Uint32Array(this.arraybytes);c[this.position>>2]=~~a&4294967295}else c=new Uint32Array(this.unalignedarraybytestemp,0,1),c[0]=~~a&4294967295,a=new Uint8Array(this.arraybytes,this.position,4),c=new Uint8Array(this.unalignedarraybytestemp,0,4),a.set(c);this.position+=4;this.position>this.length&& (this.length=this.position)};a.prototype.readUnsignedInt=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(this.position&3)){var a=new Uint32Array(this.arraybytes),c=this.position>>2;this.position+=4;return a[c]}a=new Uint32Array(this.unalignedarraybytestemp,0,1);c=new Uint8Array(this.arraybytes,this.position,4);(new Uint8Array(this.unalignedarraybytestemp,0,4)).set(c);this.position+=4;return a[0]};a.prototype.writeFloat= function(a){this.ensureWriteableSpace(4);if(0==(this.position&3)){var c=new Float32Array(this.arraybytes);c[this.position>>2]=a}else c=new Float32Array(this.unalignedarraybytestemp,0,1),c[0]=a,a=new Uint8Array(this.arraybytes,this.position,4),c=new Uint8Array(this.unalignedarraybytestemp,0,4),a.set(c);this.position+=4;this.position>this.length&&(this.length=this.position)};a.prototype.readFloat=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+ this.length;if(0==(this.position&3)){var a=new Float32Array(this.arraybytes),c=this.position>>2;this.position+=4;return a[c]}a=new Float32Array(this.unalignedarraybytestemp,0,1);c=new Uint8Array(this.arraybytes,this.position,4);(new Uint8Array(this.unalignedarraybytestemp,0,4)).set(c);this.position+=4;return a[0]};a.DEFAULT_ENDIAN=b.BIG_ENDIAN;return a}();c.ByteArray=d;d.prototype.__class__="egret.ByteArray"})(egret||(egret={})); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(a,c,n){b.call(this);this._target=null;this.loop=this.ignoreGlobalPause=this._useTicks=!1;this._actions=this._steps=this.pluginData=null;this.paused=!1;this.duration=0;this._prevPos=-1;this.position=null;this._stepPosition=this._prevPosition=0;this.passive=!1;this.initialize(a,c,n)}__extends(a,b);a.get=function(c,b,d,g){"undefined"===typeof b&&(b=null);"undefined"===typeof d&&(d=null);"undefined"===typeof g&&(g=!1);g&&a.removeTweens(c);return new a(c,b,d)}; a.removeTweens=function(c){if(c.tween_count){for(var b=a._tweens,d=b.length-1;0<=d;d--)b[d]._target==c&&(b[d].paused=!0,b.splice(d,1));c.tween_count=0}};a.pauseTweens=function(a){if(a.tween_count)for(var b=c.Tween._tweens,d=b.length-1;0<=d;d--)b[d]._target==a&&(b[d].paused=!0)};a.resumeTweens=function(a){if(a.tween_count)for(var b=c.Tween._tweens,d=b.length-1;0<=d;d--)b[d]._target==a&&(b[d].paused=!1)};a.tick=function(c,b){"undefined"===typeof b&&(b=!1);for(var d=a._tweens.concat(),g=d.length-1;0<= g;g--){var f=d[g];b&&!f.ignoreGlobalPause||f.paused||f.tick(f._useTicks?1:c)}};a._register=function(b,d){var n=b._target,g=a._tweens;if(d)n&&(n.tween_count=n.tween_count?n.tween_count+1:1),g.push(b),a._inited||(c.Ticker.getInstance().register(a.tick,null),a._inited=!0);else for(n&&n.tween_count--,n=g.length;n--;)if(g[n]==b){g.splice(n,1);break}};a.removeAllTweens=function(){for(var c=a._tweens,b=0,d=c.length;ba&& (a=0);var b=a,d=!1;b>=this.duration&&(this.loop?b%=this.duration:(b=this.duration,d=!0));if(b==this._prevPos)return d;var f=this._prevPos;this.position=this._prevPos=b;this._prevPosition=a;if(this._target)if(d)this._updateTargetProps(null,1);else if(0b);h++);h=this._steps[h-1];this._updateTargetProps(h,(this._stepPosition=b-h.t)/h.d)}0!=c&&0c&&(d=c,f=a,h=k,k=p=-1);for(;(h+=p)!=k;){c=this._actions[h];var m=c.t;(m==f||m>d&&m=a)return this;var b=this._cloneProps(this._curQueueProps);return this._addStep({d:a,p0:b,p1:b,v:c})};a.prototype.to=function(a,c,b){"undefined"===typeof b&&(b=void 0);if(isNaN(c)||0>c)c=0;return this._addStep({d:c|| 0,p0:this._cloneProps(this._curQueueProps),e:b,p1:this._cloneProps(this._appendQueueProps(a))})};a.prototype.call=function(a,c,b){"undefined"===typeof c&&(c=void 0);"undefined"===typeof b&&(b=void 0);return this._addAction({f:a,p:b?b:[],o:c?c:this._target})};a.prototype.set=function(a,c){"undefined"===typeof c&&(c=null);return this._addAction({f:this._set,o:this,p:[a,c?c:this._target]})};a.prototype.play=function(a){a||(a=this);return this.call(a.setPaused,a,[!1])};a.prototype.pause=function(a){a|| (a=this);return this.call(a.setPaused,a,[!0])};a.prototype.tick=function(a){this.paused||this.setPosition(this._prevPosition+a)};a.NONE=0;a.LOOP=1;a.REVERSE=2;a._tweens=[];a.IGNORE={};a._plugins={};a._inited=!1;return a}(c.EventDispatcher);c.Tween=b;b.prototype.__class__="egret.Tween"})(egret||(egret={})); (function(c){var b=function(){function b(){c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")}b.get=function(a){-1>a&&(a=-1);1a?b*(b*-a+1+a):b*((2-b)*a+(1-a))}};b.getPowIn=function(a){return function(b){return Math.pow(b,a)}};b.getPowOut=function(a){return function(b){return 1-Math.pow(1-b,a)}};b.getPowInOut=function(a){return function(b){return 1>(b*=2)?0.5*Math.pow(b,a):1-0.5*Math.abs(Math.pow(2-b,a))}};b.sineIn=function(a){return 1-Math.cos(a* Math.PI/2)};b.sineOut=function(a){return Math.sin(a*Math.PI/2)};b.sineInOut=function(a){return-0.5*(Math.cos(Math.PI*a)-1)};b.getBackIn=function(a){return function(b){return b*b*((a+1)*b-a)}};b.getBackOut=function(a){return function(b){b-=1;return b*b*((a+1)*b+a)+1}};b.getBackInOut=function(a){a*=1.525;return function(b){return 1>(b*=2)?0.5*b*b*((a+1)*b-a):0.5*((b-=2)*b*((a+1)*b+a)+2)}};b.circIn=function(a){return-(Math.sqrt(1-a*a)-1)};b.circOut=function(a){return Math.sqrt(1-a*a)};b.circInOut=function(a){return 1> (a*=2)?-0.5*(Math.sqrt(1-a*a)-1):0.5*(Math.sqrt(1-(a-=2)*a)+1)};b.bounceIn=function(a){return 1-b.bounceOut(1-a)};b.bounceOut=function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375};b.bounceInOut=function(a){return 0.5>a?0.5*b.bounceIn(2*a):0.5*b.bounceOut(2*a-1)+0.5};b.getElasticIn=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var g=b/c*Math.asin(1/a);return-(a*Math.pow(2,10* (d-=1))*Math.sin((d-g)*c/b))}};b.getElasticOut=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var g=b/c*Math.asin(1/a);return a*Math.pow(2,-10*d)*Math.sin((d-g)*c/b)+1}};b.getElasticInOut=function(a,b){var c=2*Math.PI;return function(d){var g=b/c*Math.asin(1/a);return 1>(d*=2)?-0.5*a*Math.pow(2,10*(d-=1))*Math.sin((d-g)*c/b):a*Math.pow(2,-10*(d-=1))*Math.sin((d-g)*c/b)*0.5+1}};b.quadIn=b.getPowIn(2);b.quadOut=b.getPowOut(2);b.quadInOut=b.getPowInOut(2);b.cubicIn=b.getPowIn(3); b.cubicOut=b.getPowOut(3);b.cubicInOut=b.getPowInOut(3);b.quartIn=b.getPowIn(4);b.quartOut=b.getPowOut(4);b.quartInOut=b.getPowInOut(4);b.quintIn=b.getPowIn(5);b.quintOut=b.getPowOut(5);b.quintInOut=b.getPowInOut(5);b.backIn=b.getBackIn(1.7);b.backOut=b.getBackOut(1.7);b.backInOut=b.getBackInOut(1.7);b.elasticIn=b.getElasticIn(1,0.3);b.elasticOut=b.getElasticOut(1,0.3);b.elasticInOut=b.getElasticInOut(1,0.3*1.5);return b}();c.Ease=b;b.prototype.__class__="egret.Ease"})(egret||(egret={})); (function(c){var b=function(){function b(){this.type=b.EFFECT}b.prototype.play=function(a){"undefined"===typeof a&&(a=!1);var b=this.audio;b&&(isNaN(b.duration)||(b.currentTime=0),b.loop=a,b.play())};b.prototype.pause=function(){var a=this.audio;a&&a.pause()};b.prototype.load=function(){var a=this.audio;a&&a.load()};b.prototype.addEventListener=function(a,b){this.audio&&this.audio.addEventListener(a,b,!1)};b.prototype.removeEventListener=function(a,b){this.audio&&this.audio.removeEventListener(a, b,!1)};b.prototype.setVolume=function(a){var b=this.audio;b&&(b.volume=a)};b.prototype.getVolume=function(){return this.audio?this.audio.volume:0};b.prototype.preload=function(a){this.type=a};b.prototype._setAudio=function(a){this.audio=a};b.MUSIC="music";b.EFFECT="effect";return b}();c.Sound=b;b.prototype.__class__="egret.Sound"})(egret||(egret={})); (function(c){var b=function(){function b(){}b.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};return b}();c.NumberUtils=b;b.prototype.__class__="egret.NumberUtils"})(egret||(egret={})); Function.prototype.bind||(Function.prototype.bind=function(c){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),d=this,a=function(){},e=function(){return d.apply(this instanceof a&&c?this:c,b.concat(Array.prototype.slice.call(arguments)))};a.prototype=this.prototype;e.prototype=new a;return e}); var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},RES; (function(c){var b=function(b){function a(a,c,n){"undefined"===typeof c&&(c=!1);"undefined"===typeof n&&(n=!1);b.call(this,a,c,n);this.itemsTotal=this.itemsLoaded=0}__extends(a,b);a.dispatchResourceEvent=function(b,c,d,g,f,h){"undefined"===typeof d&&(d="");"undefined"===typeof g&&(g=null);"undefined"===typeof f&&(f=0);"undefined"===typeof h&&(h=0);var k=egret.Event._getPropertyData(a);k.groupName=d;k.resItem=g;k.itemsLoaded=f;k.itemsTotal=h;egret.Event._dispatchByTarget(a,b,c,k)};a.ITEM_LOAD_ERROR= "itemLoadError";a.CONFIG_COMPLETE="configComplete";a.GROUP_PROGRESS="groupProgress";a.GROUP_COMPLETE="groupComplete";return a}(egret.Event);c.ResourceEvent=b;b.prototype.__class__="RES.ResourceEvent"})(RES||(RES={})); (function(c){var b=function(){function b(a,c,d){this._loaded=!1;this.name=a;this.url=c;this.type=d}Object.defineProperty(b.prototype,"loaded",{get:function(){return this.data?this.data.loaded:this._loaded},set:function(a){this.data&&(this.data.loaded=a);this._loaded=a},enumerable:!0,configurable:!0});b.prototype.toString=function(){return'[ResourceItem name="'+this.name+'" url="'+this.url+'" type="'+this.type+'"]'};b.TYPE_XML="xml";b.TYPE_IMAGE="image";b.TYPE_BIN="bin";b.TYPE_TEXT="text";b.TYPE_JSON= "json";b.TYPE_SHEET="sheet";b.TYPE_FONT="font";b.TYPE_SOUND="sound";return b}();c.ResourceItem=b;b.prototype.__class__="RES.ResourceItem"})(RES||(RES={})); (function(c){var b=function(){function b(){this.keyMap={};this.groupDic={};c.configInstance=this}b.prototype.getGroupByName=function(a){var b=[];if(!this.groupDic[a])return b;a=this.groupDic[a];for(var c=a.length,d=0;d=b&&(this.queueIndex=0);c=this.itemListDic[a[this.queueIndex]];if(0a&&(a=1);this.resLoader.thread=a};b.GROUP_CONFIG="RES__CONFIG";return b}(egret.EventDispatcher);b.prototype.__class__="Resource";var d=new b})(RES||(RES={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(c){"undefined"===typeof c&&(c=60);b.call(this);this.frameRate=c;this._time=0;60==c&&(a.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,a.cancelAnimationFrame=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||window.cancelRequestAnimationFrame|| window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame);a.requestAnimationFrame||(a.requestAnimationFrame=function(a){return window.setTimeout(a,1E3/c)});a.cancelAnimationFrame||(a.cancelAnimationFrame=function(a){return window.clearTimeout(a)});a.instance=this;this.registerListener()}__extends(a,b);a.prototype.enterFrame=function(){var b=a.instance,d=a._thisObject,n=a._callback,g=c.getTimer(),f=g- b._time;b._requestAnimationId=a.requestAnimationFrame.call(window,a.prototype.enterFrame);n.call(d,f);b._time=g};a.prototype.executeMainLoop=function(b,c){a._callback=b;a._thisObject=c;this.enterFrame()};a.prototype.reset=function(){var b=a.instance;b._requestAnimationId&&(b._time=c.getTimer(),a.cancelAnimationFrame.call(window,b._requestAnimationId),b.enterFrame())};a.prototype.registerListener=function(){var b=function(){a.instance.reset()},c=function(){document[d]||b()};window.onfocus=b;window.onblur= function(){};var d,g;"undefined"!==typeof document.hidden?(d="hidden",g="visibilitychange"):"undefined"!==typeof document.mozHidden?(d="mozHidden",g="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(d="msHidden",g="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(d="webkitHidden",g="webkitvisibilitychange");"onpageshow"in window&&"onpagehide"in window&&window.addEventListener("pageshow",b,!1);d&&g&&document.addEventListener(g,c,!1)};return a}(c.DeviceContext);c.HTML5DeviceContext= b;b.prototype.__class__="egret.HTML5DeviceContext"})(egret||(egret={}));var egret_html5_localStorage;(function(c){c.getItem=function(b){return window.localStorage.getItem(b)};c.setItem=function(b,c){window.localStorage.setItem(b,c)};c.removeItem=function(b){window.localStorage.removeItem(b)};c.clear=function(){window.localStorage.clear()};c.init=function(){for(var b in c)egret.localStorage[b]=c[b]}})(egret_html5_localStorage||(egret_html5_localStorage={}));egret_html5_localStorage.init(); __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(a){b.call(this);this.globalAlpha=1;this.canvas=a||this.createCanvas();this.canvasContext=this.canvas.getContext("2d");var c=this.canvasContext.setTransform,n=this;this.canvasContext.setTransform=function(a,b,d,e,p,m){n._matrixA=a;n._matrixB=b;n._matrixC=d;n._matrixD=e;n._matrixTx=p;n._matrixTy=m;c.call(n.canvasContext,a,b,d,e,p,m)};this._matrixA=1;this._matrixC=this._matrixB=0;this._matrixD=1;this._transformTy=this._transformTx=this._matrixTy=this._matrixTx= 0;b.call(this)}__extends(a,b);a.prototype.createCanvas=function(){var a=c.Browser.getInstance().$("#egretCanvas");if(!a){var b=document.getElementById(c.StageDelegate.canvas_div_name),a=c.Browser.getInstance().$new("canvas");a.id="egretCanvas";a.width=c.MainContext.instance.stage.stageWidth;a.height=c.MainContext.instance.stage.stageHeight;a.style.width=b.style.width;a.style.height=b.style.height;b.appendChild(a)}return a};a.prototype.clearScreen=function(){for(var a=c.RenderFilter.getInstance().getDrawAreaList(), b=0,d=a.length;b>16)+","+((c&65280)>>8)+","+(c&255)+","+a+")";this.fillStyleColor=e;this.commandQueue.push(new b(this._setStyle,this,[e]))};c.drawRect=function(c,a,e,l){this.commandQueue.push(new b(function(a,b,c,d){var e=this.renderContext;this.canvasContext.beginPath();this.canvasContext.rect(e._transformTx+a,e._transformTy+b,c,d);this.canvasContext.closePath()},this,[c,a,e,l]));this._fill()};c.drawCircle=function(c,a,e){this.commandQueue.push(new b(function(a, b,c){var d=this.renderContext;this.canvasContext.beginPath();this.canvasContext.arc(d._transformTx+a,d._transformTy+b,c,0,2*Math.PI);this.canvasContext.closePath()},this,[c,a,e]));this._fill()};c.drawRoundRect=function(c,a,e,l,n,g){this.commandQueue.push(new b(function(a,b,c,d,e,l){var g=this.renderContext;a=g._transformTx+a;b=g._transformTy+b;e/=2;l=l?l/2:e;c=a+c;d=b+d;g=d-l;this.canvasContext.beginPath();this.canvasContext.moveTo(c,g);this.canvasContext.quadraticCurveTo(c,d,c-e,d);this.canvasContext.lineTo(a+ e,d);this.canvasContext.quadraticCurveTo(a,d,a,d-l);this.canvasContext.lineTo(a,b+l);this.canvasContext.quadraticCurveTo(a,b,a+e,b);this.canvasContext.lineTo(c-e,b);this.canvasContext.quadraticCurveTo(c,b,c,b+l);this.canvasContext.lineTo(c,g);this.canvasContext.closePath()},this,[c,a,e,l,n,g]));this._fill()};c.drawEllipse=function(c,a,e,l){this.commandQueue.push(new b(function(a,b,c,d){var e=this.renderContext;this.canvasContext.save();a=e._transformTx+a;b=e._transformTy+b;var e=c>d?c:d,l=c/e;d/= e;this.canvasContext.scale(l,d);this.canvasContext.beginPath();this.canvasContext.moveTo((a+c)/l,b/d);this.canvasContext.arc(a/l,b/d,e,0,2*Math.PI);this.canvasContext.closePath();this.canvasContext.restore();this.canvasContext.stroke()},this,[c,a,e,l]));this._fill()};c.lineStyle=function(c,a,e,l,n,g,f,h){"undefined"===typeof c&&(c=NaN);"undefined"===typeof a&&(a=0);"undefined"===typeof e&&(e=1);"undefined"===typeof l&&(l=!1);"undefined"===typeof n&&(n="normal");"undefined"===typeof g&&(g=null);"undefined"=== typeof f&&(f=null);"undefined"===typeof h&&(h=3);this.strokeStyleColor&&(this.createEndLineCommand(),this.commandQueue.push(this.endLineCommand));this.strokeStyleColor=a="rgba("+(a>>16)+","+((a&65280)>>8)+","+(a&255)+","+e+")";this.commandQueue.push(new b(function(a,b){this.canvasContext.lineWidth=a;this.canvasContext.strokeStyle=b;this.canvasContext.beginPath()},this,[c,a]));"undefined"===typeof this.lineX&&(this.lineY=this.lineX=0);this.moveTo(this.lineX,this.lineY)};c.lineTo=function(c,a){this.commandQueue.push(new b(function(a, b){var c=this.renderContext;this.canvasContext.lineTo(c._transformTx+a,c._transformTy+b)},this,[c,a]));this.lineX=c;this.lineY=a};c.curveTo=function(c,a,e,l){this.commandQueue.push(new b(function(a,b,c,d){var e=this.renderContext;this.canvasContext.quadraticCurveTo(e._transformTx+a,e._transformTy+b,e._transformTx+c,e._transformTy+d)},this,[c,a,e,l]));this.lineX=e;this.lineY=l};c.moveTo=function(c,a){this.commandQueue.push(new b(function(a,b){var c=this.renderContext;this.canvasContext.moveTo(c._transformTx+ a,c._transformTy+b)},this,[c,a]))};c.clear=function(){this.lineY=this.lineX=this.commandQueue.length=0;this.fillStyleColor=this.strokeStyleColor=null};c.createEndFillCommand=function(){this.endFillCommand||(this.endFillCommand=new b(function(){this.canvasContext.fill();this.canvasContext.closePath()},this,null))};c.endFill=function(){null!=this.fillStyleColor&&this._fill();this.fillStyleColor=null};c._fill=function(){this.fillStyleColor&&(this.createEndFillCommand(),this.commandQueue.push(this.endFillCommand))}; c.createEndLineCommand=function(){this.endLineCommand||(this.endLineCommand=new b(function(){this.canvasContext.stroke();this.canvasContext.closePath()},this,null))};c._draw=function(b){this.renderContext=b;b=this.canvasContext=this.renderContext.canvasContext;b.save();var a=this.commandQueue.length;this.strokeStyleColor&&0=this.size)this._draw(),this.currentBaseTexture=a.webGLTexture;var s=this.worldTransform,r=s.a,t=s.b,u=s.c,v=s.d,x=s.tx,y=s.ty;0==h&&0==k||s.append(1,0,0,1,h,k);1==g/p&&1==f/m||s.append(p/g, 0,0,m/f,0,0);h=s.a;k=s.b;p=s.c;m=s.d;var q=s.tx,w=s.ty;s.a=r;s.b=t;s.c=u;s.d=v;s.tx=x;s.ty=y;r=a._sourceWidth;t=a._sourceHeight;a=g;s=f;b/=r;d/=t;g/=r;f/=t;r=this.vertices;t=4*this.currentBatchSize*this.vertSize;u=this.worldAlpha;r[t++]=q;r[t++]=w;r[t++]=b;r[t++]=d;r[t++]=u;r[t++]=16777215;r[t++]=h*a+q;r[t++]=k*a+w;r[t++]=g+b;r[t++]=d;r[t++]=u;r[t++]=16777215;r[t++]=h*a+p*s+q;r[t++]=m*s+k*a+w;r[t++]=g+b;r[t++]=f+d;r[t++]=u;r[t++]=16777215;r[t++]=p*s+q;r[t++]=m*s+w;r[t++]=b;r[t++]=f+d;r[t++]=u;r[t++]= 16777215;this.currentBatchSize++}};a.prototype._draw=function(){if(0!=this.currentBatchSize&&!this.contextLost){var a=c.getTimer();this.start();var b=this.gl;b.bindTexture(b.TEXTURE_2D,this.currentBaseTexture);var d=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);b.bufferSubData(b.ARRAY_BUFFER,0,d);b.drawElements(b.TRIANGLES,6*this.currentBatchSize,b.UNSIGNED_SHORT,0);this.currentBatchSize=0;this.renderCost+=c.getTimer()-a;c.Profiler.getInstance().onDrawImage()}};a.prototype.setTransform= function(a){var b=this.worldTransform;b.a=a.a;b.b=a.b;b.c=a.c;b.d=a.d;b.tx=a.tx;b.ty=a.ty};a.prototype.setAlpha=function(a,b){this.worldAlpha=a;this.setBlendMode(b)};a.prototype.createWebGLTexture=function(a){if(!a.webGLTexture){var b=this.gl;a.webGLTexture=b.createTexture();b.bindTexture(b.TEXTURE_2D,a.webGLTexture);b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,a._bitmapData);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR); b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)}};a.prototype.pushMask=function(a){this._draw();var b=this.gl;0==this.maskList.length&&(b.enable(b.STENCIL_TEST),b.stencilFunc(b.ALWAYS,1,1));var c=this.maskDataFreeList.pop();c?(c.x=a.x,c.y=a.y,c.w=a.width,c.h=a.height):c={x:a.x,y:a.y,w:a.width,h:a.height};this.maskList.push(c);b.colorMask(!1, !1,!1,!1);b.stencilOp(b.KEEP,b.KEEP,b.INCR);this.renderGraphics(c);b.colorMask(!0,!0,!0,!0);b.stencilFunc(b.NOTEQUAL,0,this.maskList.length);b.stencilOp(b.KEEP,b.KEEP,b.KEEP)};a.prototype.popMask=function(){this._draw();var a=this.gl,b=this.maskList.pop();b&&(a.colorMask(!1,!1,!1,!1),a.stencilOp(a.KEEP,a.KEEP,a.DECR),this.renderGraphics(b),a.colorMask(!0,!0,!0,!0),a.stencilFunc(a.NOTEQUAL,0,this.maskList.length),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),this.maskDataFreeList.push(b));0==this.maskList.length&& a.disable(a.STENCIL_TEST)};a.prototype.setupFont=function(a){var b=this.canvasContext,c=a.italic?"italic ":"normal ",c=c+(a.bold?"bold ":"normal "),c=c+(a.size+"px "+a.fontFamily);b.font=c;b.textAlign="left";b.textBaseline="middle"};a.prototype.measureText=function(a){return this.canvasContext.measureText(a).width};a.prototype.renderGraphics=function(a){var b=this.gl,c=this.shaderManager.primitiveShader;this.graphicsPoints?(this.graphicsPoints.length=0,this.graphicsIndices.length=0):(this.graphicsPoints= [],this.graphicsIndices=[],this.graphicsBuffer=b.createBuffer(),this.graphicsIndexBuffer=b.createBuffer());this.updateGraphics(a);this.shaderManager.activateShader(c);b.blendFunc(b.ONE,b.ONE_MINUS_SRC_ALPHA);b.uniformMatrix3fv(c.translationMatrix,!1,this.worldTransform.toArray(!0));b.uniform2f(c.projectionVector,this.projectionX,-this.projectionY);b.uniform2f(c.offsetVector,0,0);b.uniform3fv(c.tintColor,[1,1,1]);b.uniform1f(c.alpha,this.worldAlpha);b.bindBuffer(b.ARRAY_BUFFER,this.graphicsBuffer); b.vertexAttribPointer(c.aVertexPosition,2,b.FLOAT,!1,24,0);b.vertexAttribPointer(c.colorAttribute,4,b.FLOAT,!1,24,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer);b.drawElements(b.TRIANGLE_STRIP,this.graphicsIndices.length,b.UNSIGNED_SHORT,0);this.shaderManager.activateShader(this.shaderManager.defaultShader)};a.prototype.updateGraphics=function(a){var b=this.gl;this.buildRectangle(a);b.bindBuffer(b.ARRAY_BUFFER,this.graphicsBuffer);b.bufferData(b.ARRAY_BUFFER,new Float32Array(this.graphicsPoints), b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer);b.bufferData(b.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.graphicsIndices),b.STATIC_DRAW)};a.prototype.buildRectangle=function(a){var b=a.x,c=a.y,d=a.w;a=a.h;var f=this.graphicsPoints,h=this.graphicsIndices,k=f.length/6;f.push(b,c);f.push(0,0,0,1);f.push(b+d,c);f.push(0,0,0,1);f.push(b,c+a);f.push(0,0,0,1);f.push(b+d,c+a);f.push(0,0,0,1);h.push(k,k,k+1,k+2,k+3,k+3)};a.blendModesWebGL={};return a}(c.RendererContext);c.WebGLRenderer= b;b.prototype.__class__="egret.WebGLRenderer"})(egret||(egret={})); (function(c){var b=function(){function b(){}b.compileProgram=function(a,c,l){l=b.compileFragmentShader(a,l);c=b.compileVertexShader(a,c);var n=a.createProgram();a.attachShader(n,c);a.attachShader(n,l);a.linkProgram(n);a.getProgramParameter(n,a.LINK_STATUS)||console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");return n};b.compileFragmentShader=function(a,c){return b._compileShader(a,c,a.FRAGMENT_SHADER)};b.compileVertexShader=function(a,c){return b._compileShader(a,c,a.VERTEX_SHADER)};b._compileShader= function(a,b,c){c=a.createShader(c);a.shaderSource(c,b);a.compileShader(c);return a.getShaderParameter(c,a.COMPILE_STATUS)?c:(console.log(a.getShaderInfoLog(c)),null)};b.checkCanUseWebGL=function(){if(void 0==b.canUseWebGL)try{var a=document.createElement("canvas");b.canUseWebGL=!!window.WebGLRenderingContext&&!(!a.getContext("webgl")&&!a.getContext("experimental-webgl"))}catch(c){b.canUseWebGL=!1}return b.canUseWebGL};return b}();c.WebGLUtils=b;b.prototype.__class__="egret.WebGLUtils"})(egret||(egret= {})); (function(c){var b=function(){function b(a){this.maxAttibs=10;this.attribState=[];this.tempAttribState=[];for(var c=0;c a.x||0>a.y||a.x>c.MainContext.instance.stage.width||a.y>c.MainContext.instance.stage.height?!0:!1};a.prototype.dispatchLeaveStageEvent=function(){c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)};a.prototype._onTouchBegin=function(a){var b=this.getLocation(this.rootDiv,a),c=-1;a.hasOwnProperty("identifier")&&(c=a.identifier);this.onTouchBegan(b.x,b.y,c)};a.prototype._onTouchMove=function(a){var b=this.getLocation(this.rootDiv,a),c=-1;a.hasOwnProperty("identifier")&&(c=a.identifier); this.onTouchMove(b.x,b.y,c)};a.prototype._onTouchEnd=function(a){var b=this.getLocation(this.rootDiv,a),c=-1;a.hasOwnProperty("identifier")&&(c=a.identifier);this.onTouchEnd(b.x,b.y,c)};a.prototype.getLocation=function(a,b){var d=document.documentElement,g=window,f,h;"function"===typeof a.getBoundingClientRect?(h=a.getBoundingClientRect(),f=h.left,h=h.top):h=f=0;f+=g.pageXOffset-d.clientLeft;h+=g.pageYOffset-d.clientTop;null!=b.pageX?(d=b.pageX,g=b.pageY):(f-=document.body.scrollLeft,h-=document.body.scrollTop, d=b.clientX,g=b.clientY);var k=c.Point.identity;k.x=(d-f)/c.StageDelegate.getInstance().getScaleX();k.y=(g-h)/c.StageDelegate.getInstance().getScaleY();return k};return a}(c.TouchContext);c.HTML5TouchContext=b;b.prototype.__class__="egret.HTML5TouchContext"})(egret||(egret={}));__extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d}; (function(c){var b=function(b){function a(){b.call(this);this._size=30;this._isShow=!0;this._inputType=this._text="";this._canUse=!1}__extends(a,b);a.prototype._getText=function(){return this._isShow?this.inputElement.value:this._text};a.prototype._setText=function(a){this._isShow?this.inputElement.value=a:this._text=a};a.prototype._setTextType=function(a){this.inputElement.type=a};a.prototype._getTextType=function(){return this.inputElement.type};a.prototype._setMultiline=function(a){b.prototype._setMultiline.call(this, a);this._createInput()};a.prototype._open=function(a,b,d,g){"undefined"===typeof d&&(d=160);var f=c.StageDelegate.getInstance().getScaleX(),h=c.StageDelegate.getInstance().getScaleY();g=c.Browser.getInstance().$new("div");g.position.x=a*f;g.position.y=b*h;g.style.width=d+"px";g.scale.x=f;g.scale.y=h;g.transforms();g.style[egret_dom.getTrans("transformOrigin")]="0% 0% 0px";a=this.getStageDelegateDiv();a.appendChild(g);this.div=g;this._createInput();g&&!g.parentNode&&(a=this.getStageDelegateDiv(),a.appendChild(g)); g.style.display="block";this._call=this.onHandler.bind(this)};a.prototype._createInput=function(){var a=!1,b;this._multiline&&"textarea"!=this._inputType?(a=!0,this._inputType="textarea",b=document.createElement("textarea")):this._multiline||"input"==this._inputType||(a=!0,this._inputType="input",b=document.createElement("input"));a&&(b.type="text",b.style.fontSize=this._size+"px",b.style.lineHeight=this._size+"px",b.style.textAlign="left",b.style.fontFamily="Arial",b.style.fontStyle="normal",b.style.fontWeight= "normal",b.style.color="#FFFFFF",b.style.border="none",b.style.background="none",b.style.width=this.div.style.width,b.style.padding="0",b.style.outline="medium",this.inputElement&&this.inputElement.parentNode?(this.inputElement.parentNode.removeChild(this.inputElement),this._removeListeners(),this.inputElement=b,this._addListeners()):this.inputElement=b,this.div.appendChild(b))};a.prototype._addListeners=function(){window.navigator.msPointerEnabled?(this.addListener("MSPointerDown"),this.addListener("MSPointerUp")): c.MainContext.deviceType==c.MainContext.DEVICE_MOBILE?(this.addListener("touchstart"),this.addListener("touchend"),this.addListener("touchcancel")):c.MainContext.deviceType==c.MainContext.DEVICE_PC&&(this.addListener("mousedown"),this.addListener("mouseup"));this.addListener("focus");this.addListener("blur");this._isShow=!0;this._closeInput();this.closeKeyboard()};a.prototype._removeListeners=function(){window.navigator.msPointerEnabled?(this.removeListener("MSPointerDown"),this.removeListener("MSPointerUp")): c.MainContext.deviceType==c.MainContext.DEVICE_MOBILE?(this.removeListener("touchstart"),this.removeListener("touchend"),this.removeListener("touchcancel")):c.MainContext.deviceType==c.MainContext.DEVICE_PC&&(this.removeListener("mousedown"),this.removeListener("mouseup"));this.removeListener("blur");this.removeListener("focus")};a.prototype.addListener=function(a){this.inputElement.addEventListener(a,this._call)};a.prototype.removeListener=function(a){this.inputElement.removeEventListener(a,this._call)}; a.prototype.onHandler=function(a){a.isScroll=!0;"blur"==a.type?(this.dispatchEvent(new c.Event("blur")),this._closeInput()):"focus"==a.type?this._canUse?(this._canUse=!1,this._openInput(),this.dispatchEvent(new c.Event("focus"))):(a.isScroll=!1,this.inputElement.blur()):("touchstart"==a.type||"mousedown"==a.type||"MSPointerDown"==a.type)&&this._isShow&&a.stopPropagation()};a.prototype._show=function(){this._canUse=!0};a.prototype._hide=function(){this._canUse=!1;this._closeInput();this.closeKeyboard()}; a.prototype._openInput=function(){this._isShow||(this._isShow=!0,this.inputElement.value=this._text)};a.prototype._closeInput=function(){this._isShow&&(this._isShow=!1,this._text=this.inputElement.value,this.inputElement.value="")};a.prototype.closeKeyboard=function(){this.inputElement.focus();this.inputElement.blur()};a.prototype.getStageDelegateDiv=function(){var a=c.Browser.getInstance().$("#StageDelegateDiv");a||(a=c.Browser.getInstance().$new("div"),a.id="StageDelegateDiv",document.getElementById(c.StageDelegate.canvas_div_name).appendChild(a), a.transforms());return a};a.prototype._remove=function(){var a=this.div;a&&a.parentNode&&a.parentNode.removeChild(a)};a.prototype.changePosition=function(a,b){var d=c.StageDelegate.getInstance().getScaleX(),g=c.StageDelegate.getInstance().getScaleY();this.div.position.x=a*d;this.div.position.y=b*g;this.div.transforms()};a.prototype.changeSize=function(a,b){this.inputElement.style.width=a+"px";this.div.style.width=a+"px";this.div.transforms()};a.prototype.setSize=function(a){this._size=a;this.inputElement.style.fontSize= this._size+"px"};a.prototype.setTextColor=function(a){this.inputElement.style.color=a};a.prototype.setTextFontFamily=function(a){this.inputElement.style.fontFamily=a};a.prototype.setWidth=function(a){this.inputElement.style.width=a+"px"};a.prototype.setHeight=function(a){this.inputElement.style.height=a+"px"};return a}(c.StageText);c.HTML5StageText=b;b.prototype.__class__="egret.HTML5StageText"})(egret||(egret={}));egret.StageText.create=function(){return new egret.HTML5StageText}; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},ImgBtn=function(c){function b(b,a,e){c.call(this);e&&(this.resName=e);this.initBtn(b,a)}__extends(b,c);b.prototype.initBtn=function(b,a,c){this.removeChildren();this.resName?(this.upImg=ResourceUtils.createBitmapFromSheet(b,this.resName),this.downImg=ResourceUtils.createBitmapFromSheet(a,this.resName)):(this.upImg=ResourceUtils.createBitmapByName(b), this.downImg=ResourceUtils.createBitmapByName(a));this.downImg.visible=!1;this.upImg.anchorX=0.5;this.upImg.anchorY=0.5;this.downImg.anchorX=0.5;this.downImg.anchorY=0.5;this.addChild(this.downImg);this.addChild(this.upImg);this.touchEnabled=!0;this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this);this.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this);this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this)};b.prototype.touchBegin=function(b){this.downImg.visible= !0;this.upImg.visible=!1};b.prototype.touchEnd=function(b){this.downImg.visible=!1;this.upImg.visible=!0};return b}(egret.Sprite);ImgBtn.prototype.__class__="ImgBtn"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TipsBaseView=function(c){function b(){c.call(this)}__extends(b,c);b.prototype.drawBorder=function(b,a,c,l){this.width=b;this.height=a;this.bp=520==b?ResourceUtils.createBitmapByName("bj"):200==b?ResourceUtils.createBitmapByName("taskTitle"):ResourceUtils.createBitmapByName("btnbj");this.addChildAt(this.bp,0)};return b}(egret.Sprite); TipsBaseView.prototype.__class__="TipsBaseView";var ResourceUtils=function(){function c(){}c.createBitmapByName=function(b){var c=new egret.Bitmap;b=RES.getRes(b);c.texture=b;return c};c.createBitmapFromSheet=function(b,c){"undefined"===typeof c&&(c="gameRes");var a=RES.getRes(c).getTexture(b),e=new egret.Bitmap;e.texture=a;return e};c.getTextureFromSheet=function(b,c){"undefined"===typeof c&&(c="gameRes");return RES.getRes(c).getTexture(b)};return c}();ResourceUtils.prototype.__class__="ResourceUtils"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},Title=function(c){function b(b,a){c.call(this);this.tw=18;this.th=16;this.tColor=16777215;this.bBj=ResourceUtils.createBitmapByName("processB");this.bBj.visible=!1;this.addChild(this.bBj);this.hBj=ResourceUtils.createBitmapByName("processH");this.hBj.visible=!1;this.addChild(this.hBj);this.update(b,a,16777215)}__extends(b,c);b.prototype.update= function(b,a,c){this.tw=b;this.th=a;this.tColor=c;16777215==c?this.hBj.visible=!1:(this.bBj.visible=!1,this.hBj.visible=!0)};return b}(egret.Sprite);Title.prototype.__class__="Title";var Consts=function(){function c(){}c.Game_Width=570;c.title="\u611a\u516c\u79fb\u5c71";c.desc="\u4ece\u524d\u6709\u4e2a\u4f20\u8bf4\uff0c\u611a\u516c\u8eba\u7740\u90fd\u80fd\u751f\u5b69\u5b50\u3002";c.iconLink="http://egret-game.b0.upaiyun.com/foolMan/120.png";return c}();Consts.prototype.__class__="Consts"; var NumUtils=function(){function c(){}c.numToString=function(b){c.numString=Math.floor(b).toString();c.numString=c.numString.split("").reverse().join("").replace(/(\d{3})/g,"$1,").split("").reverse().join("");b=c.numString.length;","==c.numString.charAt(0)&&(c.numString=c.numString.slice(1,b));return c.numString};c.stringToString=function(b){c.sS=b;b=c.sS.indexOf(".");-1!=b&&(c.sS=c.sS.substring(0,b));c.sS=c.sS.split("").reverse().join("").replace(/(\d{3})/g,"$1,").split("").reverse().join("");b= c.sS.length;","==c.sS.charAt(0)&&(c.sS=c.sS.slice(1,b));return c.sS};c.numToW=function(b){};return c}();NumUtils.prototype.__class__="NumUtils"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TitleTips=function(c){function b(){c.call(this);this.bgAlpha=0.8;this.init()}__extends(b,c);b.prototype.init=function(){this.maskBj=ResourceUtils.createBitmapByName("mask");this.maskBj.width=Consts.Game_Width;this.maskBj.height=30;this.maskBj.alpha=0.6;this.addChild(this.maskBj);this.leftLb=new egret.TextField;this.leftLb.x=10;this.leftLb.y= 5;this.leftLb.size=20;this.addChild(this.leftLb);this.leftTxt=new egret.TextField;this.leftTxt.x=58;this.leftTxt.y=5;this.leftTxt.size=20;this.rightLb=new egret.TextField;this.rightLb.x=330;this.rightLb.y=5;this.rightLb.width=230;this.rightLb.textAlign="right";this.rightLb.size=20;this.addChild(this.rightLb);this.rightTxt=new egret.TextField;this.rightTxt.x=510;this.rightTxt.y=5;this.rightTxt.size=20;this.width=Consts.Game_Width};b.prototype.updateLb=function(b,a,c){this.bgAlpha=c;this.leftTxtS=this.leftLb.text= b;this.rightTxtS=this.rightLb.text=a;this.leftLb.text=b+"0 /\u79d2";this.rightLb.text=a+"0%"};b.prototype.updateTxt=function(b,a){this.leftLb.text=this.leftTxtS+NumUtils.numToString(b);this.rightLb.text=NumUtils.numToString(a)+" /\u79d2"};b.prototype.updateLeft=function(b){this.leftLb.text=this.leftTxtS+NumUtils.numToString(b)+" /\u79d2"};b.prototype.updateRight=function(b){this.rightLb.text=this.rightTxtS+Math.floor(100*b).toString()+"%"};b.prototype.resetRightX=function(){};return b}(egret.Sprite); TitleTips.prototype.__class__="TitleTips";var AGK=function(){return function(){}}();AGK.prototype.__class__="AGK"; var HouseType=function(){function c(){}c.H0=0;c.H1=1;c.H2=2;c.H3=3;c.H4=4;c.H0_ICON="10000";c.H0_NEED=1;c.H0_TITLE="\u8349\u623f";c.H0_DESC="\u4e0d\u8981\u770b\u4e0d\u8d77\u8349\u623f\uff0c\u6bcf\u6b21\u70b9\u51fb+1\u4e2a\u5b50\u5b59\u54df\u3002";c.H0_JC=1;c.H1_ICON="10010";c.H1_NEED=100;c.H1_TITLE="\u8c6a\u5b85";c.H1_DESC="\u5176\u5b9e\u5c31\u662f\u4e00\u4e2a\u724c\u533e\u5566\uff5e\uff08\u6bcf\u6b21\u70b9\u51fb+20\u4e2a\u513f\u5b59\uff0c\u6bcf\u79d2\u513f\u5b59\u4ea7\u91cf\u63d0\u5347110%\uff09";c.H1_JC= 1.1;c.H2_ICON="10020";c.H2_NEED=500;c.H2_TITLE="\u8349\u623f";c.H2_DESC="";c.H2_JC=1;c.H3_ICON="10030";c.H3_NEED=500;c.H3_TITLE="\u8349\u623f";c.H3_DESC="";c.H3_JC=1;c.H4_ICON="10040";c.H4_NEED=500;c.H4_TITLE="\u8349\u623f";c.H4_DESC="";c.H4_JC=1;return c}();HouseType.prototype.__class__="HouseType"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},Progress=function(c){function b(b){c.call(this);this.lg=18;this.currentLg=0;this.magin=2;this.tw=18;this.th=16;this.lg=b;this.init()}__extends(b,c);b.prototype.init=function(){this.bg=ResourceUtils.createBitmapByName("process");this.addChild(this.bg);this.bg2m=new egret.Rectangle;this.bg2m.width=360;this.bg2m.height=16;this.mask=this.bg2m; this.bg2=ResourceUtils.createBitmapByName("process2");this.bg2.x=-360;this.addChild(this.bg2)};b.prototype.update=function(b,a){"undefined"===typeof a&&(a=!1);b<=this.lg&&(this.currentLg=b);if(a)for(var c=0;c=b?this.timeTip.textColor=16711680:a&&(this.timeTip.textColor=16777215);this.timeTip.text=b.toString()+"''"};b.prototype.playTimeTxt=function(b){this.isPlayingRed1?(this.timeTip.textColor=16777215,this.isPlayingRed1=!1):(this.timeTip.textColor=16711680,this.isPlayingRed1=!0);50<=this.ssTimer1.currentCount()&&(this.ssTimer1.stop(),this.ssTimer1.reset(),this.isPlayingRed1=!1,this.timeTip.textColor=16777215)};b.prototype.updateDCL= function(b){this.titleTips.updateLeft(b)};b.prototype.updateJC=function(b){this.titleTips.updateRight(b)};b.prototype.ssTargetTxt=function(){this.ssTimer.start()};b.prototype.playTargetTxt=function(b){this.isPlayingRed?(this.targetLb.textColor=16777215,this.targetTxt.textColor=16777215,this.timeTip.textColor=16777215,this.isPlayingRed=!1):(this.targetLb.textColor=16711680,this.targetTxt.textColor=16711680,this.timeTip.textColor=16711680,this.isPlayingRed=!0);10<=this.ssTimer.currentCount()&&(this.ssTimer.stop(), this.ssTimer.reset(),this.isPlayingRed=!1,this.targetLb.textColor=16777215,this.timeTip.textColor=16777215)};return b}(egret.Sprite);TopView.prototype.__class__="TopView"; var TaskManager=function(){function c(){this.hasGood=this.dcl=this.runTime=this.targetTime=this.currentNum=this.targetNum=0;this.stop=!1;this.currentTaskIndex=0;this.taskList=[];this.fxjs=1;this.taskIsPause=!0;this.ydArr=[];this.isLastTask=!1;this.proLg=this.difDcl=0;if(null!=c._instance)throw Error("singleton");}c.instance=function(){return null==this._instance?this._instance=new c:this._instance};c.prototype.initTaskManager=function(){this.taskLayer.taskView.addEventListener(egret.TouchEvent.TOUCH_TAP, this.closeTaskView,this);this.taskLayer.taskFailView.restartBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.restartGame,this);this.taskLayer.taskFailView.qzBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.shareGame,this);this.taskLayer.taskFailView.andrb.addEventListener(egret.TouchEvent.TOUCH_TAP,this.loadGame,this);this.initTaskList()};c.prototype.loadGame=function(b){console.log("loadGameEvent");ShareUtils.loadGame()};c.prototype.initTaskList=function(){for(var b=RES.getRes("yindaoRes"), c=b.yindao.length,a=0;a=this.targetNum?(this.pauseTask(),this.pauseGame(),this.finishedTask()):(this.runTime>=this.targetTime&&this.failedTask(),this.updateGameTitle())};c.prototype.updateCurrentNum=function(b){this.taskIsPause|| (this.currentNum+=b)};c.prototype.finishedTask=function(){this.currentTask.isShowTip?(this.gameTitle.updateProgress(100),GameContent.me.gameLayer.house.touchEnabled=!1,this.startTask(),this.isLastTask||this.taskLayer.showFinishTxt(this.currentTask.title,this.currentTask.desc,this.currentTask.icon,this.currentTask.targetS)):this.startTask()};c.prototype.failedTask=function(){this.pauseTask();GameContent.me.stopGame();this.lszg=ShareUtils.lszg;this.lszg=this.timeTips&&(this.timeTips=0);this.gameTitle.updateProgress(this.proLg);this.gameTitle.updateTimeTxt(this.timeTips)};return c}();TaskManager.prototype.__class__="TaskManager";var GK=function(){return function(){this.itemNum=0;this.needsList=[];this.currentIndex=this.ADD=0;this.list=[]}}();GK.prototype.__class__="GK"; var GKConsts=function(){function c(){}c.HOME=0;c.GK1=1;c.GK2=2;c.GK3=3;c.GK4=4;c.GK_TargetTxt="\u9700\u8981\u5b50\u5b59\uff1a";c.GK_CurrentTxt="\u5f53\u524d\u5b50\u5b59\uff1a";c.GK1_Icon="20100";c.GK1_Title="\u8349\u4e1b ";c.GK1_Desc="\u4eba\u7c7b\u6587\u660e\u7684\u7e41\u884d\uff0c\u4ece\u8349\u4e1b\u5f00\u59cb\uff01";c.GK2_Icon="20200";c.GK2_Title="\u4e5d\u9633\u795e\u529f ";c.GK2_Desc="\u4f20\u8bf4\u4e2d\u7684\u6b66\u6797\u79d8\u7c4d\uff0c\u63d0\u9ad8\u547d\u4e2d\u7387\uff01";c.GK3_Icon="20300"; c.GK3_Title="\u795e\u65cf\u6c34\u6676 ";c.GK3_Desc="\u795e\u65cf\u91d1\u514b\u62c9\u6280\u672f\uff0c\u63d0\u9ad8\u4eba\u53e3\u4ea9\u4ea7\uff01";c.GK4_Icon="20400";c.GK4_Title="\u514b\u9686\u4eba\u88c5\u7f6e ";c.GK4_Desc="\u57fa\u56e0\u6280\u672f\uff0c\u65e0\u6027\u5927\u6279\u91cf\u7e41\u6b96\uff01";c.GK1_First=1;c.GK1_JS=2;c.GK1_DCL=1;c.GK2_First=50;c.GK2_JS=1.7;c.GK2_DCL=10;c.GK3_First=200;c.GK3_JS=1.6;c.GK3_DCL=50;c.GK4_First=2500;c.GK4_JS=1.5;c.GK4_DCL=100;return c}(); GKConsts.prototype.__class__="GKConsts";var GKType=function(){function c(){}c.HOME=0;c.GK1=1;c.GK2=2;c.GK3=3;c.GK4=4;return c}();GKType.prototype.__class__="GKType"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},House=function(c){function b(){c.call(this,"10000","10005","houseRes");this.houseType=HouseType.H0;this.downImg.scaleY=1.2}__extends(b,c);b.prototype.setHouseType=function(b){console.log("houseType:::::",b);this.houseType=b;this.resetUpAndDownByType(b)};b.prototype.resetUpAndDownByType=function(b){switch(b){case HouseType.H0:this.initBtn("10000", "10005","houseRes");this.downImg.scaleY=1.2;break;case HouseType.H1:this.initBtn("10010","10015","houseRes");this.downImg.scaleY=1.2;break;case HouseType.H2:this.initBtn("10020","10025","houseRes");this.downImg.scaleY=1.2;break;case HouseType.H3:this.initBtn("10030","10035","houseRes");this.downImg.scaleY=1.3;break;case HouseType.H4:this.initBtn("10040","10045","houseRes"),this.downImg.scaleY=1.2}};return b}(ImgBtn);House.prototype.__class__="House"; var RoleState=function(){function c(){}c.FLY=0;c.RUN=1;c.STAND=2;c.DIE=3;c.FLYANDDIE=4;return c}();RoleState.prototype.__class__="RoleState";var RoleType=function(){function c(){}c.PT=0;c.BIG=1;c.QUN=2;c.DOG=3;c.BUS=4;return c}();RoleType.prototype.__class__="RoleType"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},BaseBitmap=function(c){function b(b){c.call(this);this._img=b;this.initImg()}__extends(b,c);b.prototype.initImg=function(){this.addChild(this._img)};return b}(egret.Sprite);BaseBitmap.prototype.__class__="BaseBitmap"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},BaseMc=function(c){function b(b){c.call(this);this.__currentFrame=0;this.__frameRate=24;this.__frameTime=1E3/24;this.__endFrame=this.__startFrame=this.__currentTime=0;this.__imgArr=b;this.initMc()}__extends(b,c);b.prototype.initMc=function(){for(var b=0;bthis.__frameTime&&(this.__currentTime=0,this.playImg())};b.prototype.playImg=function(){this.__imgArr[this.__currentFrame].parent&&this.removeChild(this.__imgArr[this.__currentFrame]);this.__currentFramec.length)for(l=100-c.length,c=c.length+1,g=0;g=this.needNum?(DataManager.instance().currentTotal-=this.needNum,this.gameLayerAddItem(),this.showItemLayer(null)):this.isBuyColor?(this.itemLayer.buyView.currentLb.textColor=16711680,this.isBuyColor=!1):(this.itemLayer.buyView.currentLb.textColor=0,this.isBuyColor=!0);this.colseGKNumber+=1};c.prototype.gameLayerAddItem=function(){var b,c;switch(this.clickGKType){case GKConsts.GK1:b=ResourceUtils.createBitmapFromSheet(GKConsts.GK1_Icon, "gkRes");b=new BaseBitmap(b);c=this.gameLayer.gk1.gkData.currentIndex+1;this.needNum=this.gameLayer.gk1.gkData.list[c].need;this.gameLayer.gk1.addItem(b,this.needNum);break;case GKConsts.GK2:b=ResourceUtils.createBitmapFromSheet(GKConsts.GK2_Icon,"gkRes");b=new BaseBitmap(b);c=this.gameLayer.gk2.gkData.currentIndex+1;this.needNum=this.gameLayer.gk2.gkData.list[c].need;this.gameLayer.gk2.addItem(b,this.needNum);break;case GKConsts.GK3:b=ResourceUtils.createBitmapFromSheet(GKConsts.GK3_Icon,"gkRes"); b=new BaseBitmap(b);c=this.gameLayer.gk3.gkData.currentIndex+1;this.needNum=this.gameLayer.gk3.gkData.list[c].need;this.gameLayer.gk3.addItem(b,this.needNum);break;case GKConsts.GK4:b=ResourceUtils.createBitmapFromSheet(GKConsts.GK4_Icon,"gkRes"),b=new BaseBitmap(b),c=this.gameLayer.gk4.gkData.currentIndex+1,this.needNum=this.gameLayer.gk4.gkData.list[c].need,this.gameLayer.gk4.addItem(b,this.needNum)}};c.prototype.showBuyHouse=function(){this.itemLayer.visible=!0;this.itemLayer.showBuyHouseView()}; return c}();GKManager.prototype.__class__="GKManager"; var SoundManager=function(){function c(){this.soundState=!0;if(null!=c._instance)throw Error("singleton");}c.instance=function(){return null==this._instance?this._instance=new c:this._instance};c.prototype.init=function(){this.clickSound=RES.getRes("clickSound");this.bjSound=RES.getRes("bjSound");this.gameTitle.soundBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.soundBtnClick,this)};c.prototype.restart=function(){this.playBj()};c.prototype.stop=function(){};c.prototype.soundBtnClick=function(){this.soundState= !this.soundState;this.playBj()};c.prototype.playBj=function(){this.soundState?this.bjSound.play(!0):this.bjSound.pause()};c.prototype.playHouseClick=function(){};return c}();SoundManager.prototype.__class__="SoundManager"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},Role=function(c){function b(b,a){c.call(this);this.isInHome=!0;this.freeCurrentCount=this.freeState=this.bornDelay=this.bornCurrentCount=this.bornState=this.roleLifeState=0;this.freeTargetCount=20;this.dieCurrentCount=this.dieState=this.freeDelay=0;this.dieDelay=100;this.runTime=this.stantTime=2E3;this.randomStepX=8;this.randomStepY= 4;this.ptrdX=8;this.ptrdY=5;this.bigrdX=8;this.bigrdY=4;this.qunrdX=6;this.qunrdY=4;this.dogrdX=6;this.dogrdY=4;this.busrdX=6;this.busrdY=4;this.bcY=this.bcX=0;this.roleType=b;this.roleState=a;this.initFace(b)}__extends(b,c);b.prototype.initFace=function(b){this.bitmapArr=[];b=RoleFactory.getInstance().getRoleImgArrByType(b);for(var a=0;a=this.alpha&&(this.alpha+=0.1),this.x+=this.stepX,this.y+=this.stepY,this.bornCurrentCount++)};b.prototype.playFree=function(b){this.freeCurrentCount>=this.freeTargetCount?(this.selfTimer.stop(),this.resetFree()):(this.x+=this.randomStepX,this.y+=this.randomStepY,this.hitMoveRect(), this.freeCurrentCount++)};b.prototype.playDie=function(b){10<=this.dieCurrentCount?this.dispose():(this.face.rotation-=36,this.alpha-=0.1,this.y+=12,this.dieCurrentCount++)};b.prototype.initBorn=function(){this.bornDelay=this.bornCurrentCount=this.roleLifeState=0;this.setFaceRun()};b.prototype.initFree=function(){this.roleLifeState=1;this.freeDelay=this.freeCurrentCount=0;this.randomDir();this.setFaceRun()};b.prototype.resetFree=function(){this.roleLifeState=1;this.freeDelay=this.freeCurrentCount= 0;this.randomDir();this.setFaceStand();egret.setTimeout(this.restartTicker,this,this.stantTime)};b.prototype.restartTicker=function(){this.setFaceRun();this.selfTimer.start()};b.prototype.initDie=function(){this.roleLifeState=2;this.dieDelay=this.dieCurrentCount=0;this.setFaceDie();this.face.anchorX=0.5;this.face.anchorY=0.5};b.prototype.autoSelf=function(){this.freeCurrentCount>=this.freeTargetCount?this.initFree():(this.x+=this.randomStepX,this.y+=this.randomStepY,this.hitMoveRect())};b.prototype.hitMoveRect= function(){0>this.x&&(this.isInHome?this.dispose():this.randomStepX=-this.randomStepX);640this.moveRect.y+this.moveRect.height-this.face.height&&(this.isInHome?this.initDie():this.randomStepY=-this.randomStepY)};b.prototype.setFaceRun=function(){this.face.playPart(0,this.bitmapArr.length-2)};b.prototype.setFaceStand=function(){this.face.gotoAndStop(0)};b.prototype.setFaceDie= function(){this.face.gotoAndStop(this.bitmapArr.length-1);this.face.anchorX=0.5;this.face.anchorY=0.5};b.prototype.fly=function(){this.face.playPart(0,this.bitmapArr.length-2)};b.prototype.setFaceFlyAndDie=function(){this.face.playPart(0,this.bitmapArr.length-2)};b.prototype.resetBC=function(){switch(this.roleType){case RoleType.PT:this.bcX=this.ptrdX;this.bcY=this.ptrdY;break;case RoleType.BIG:this.bcX=this.bigrdX;this.bcY=this.bigrdY;break;case RoleType.QUN:this.bcX=this.qunrdX;this.bcY=this.qunrdY; break;case RoleType.BUS:this.bcX=this.busrdX;this.bcY=this.busrdY;break;case RoleType.DOG:this.bcX=this.dogrdX,this.bcY=this.dogrdY}};b.prototype.randomDir=function(){var b=Math.random(),a=Math.random();this.randomStepX=0.5=this.alpha&&(egret.Ticker.getInstance().unregister(this.loop2,this),this.dispose()))};b.prototype.dispose=function(){this.parent&&(this.size=25,GameLayer.recycleTxt(this),this.parent.removeChild(this))};return b}(egret.TextField); AlphaTxt.prototype.__class__="AlphaTxt"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},ArrowBtn=function(c){function b(b){c.call(this);this.upState=!1;this.arrow="downArrow1"==b||"downArrow"==b?ResourceUtils.createBitmapByName("downArrow"):ResourceUtils.createBitmapByName(b);this.lefta=b;this.addChild(this.arrow);this.dTimer=new egret.Timer(200,5E4);this.dTimer.addEventListener(egret.TimerEvent.TIMER,this.play,this);this.dTimer.start(); "upArrow"==b?(this.bgTxt=new BgTxt,this.bgTxt.updateTxt("\u5c0f\u5c0f\u7684\u8305\u5c4b\u6210\u5c31\u4e86\u591a\u5c11\u751f\u547d\uff0c\u70b9\u51fb\u8305\u5c4b\u5f00\u59cbOOXX\u521b\u9020\u5c0f\u751f\u547d\u5427"),this.bgTxt.x=-110,this.bgTxt.y=-190,this.addChild(this.bgTxt)):"downArrow"==b?(this.bgTxt=new BgTxt,this.bgTxt.updateTxt("\u636e\u8bf4\u53e4\u4eba\u90fd\u5f88\u559c\u6b22\u201c\u91ce\u6218\u201d\u54e6,\u5efa\u9020\u4e00\u4e2a\u8349\u4e1b\u5c31\u4f1a\u81ea\u52a8\u751f\u4ea7\u513f\u5b59\u3002"), this.bgTxt.x=-320,this.bgTxt.y=175,this.addChild(this.bgTxt)):"leftArrow"==b?(this.bgTxt=new BgTxt,this.bgTxt.updateTxt("\u623f\u5c4b\u6f02\u4eae\u4e86\uff0c\u624d\u80fd\u4e3a\u66f4\u597d\u7e41\u884d\u5b50\u5b59\u521b\u9020\u6761\u4ef6\uff0c\u70b9\u51fb\u5347\u7ea7\u5427\u3002"),this.bgTxt.x=-100,this.bgTxt.y=-90,this.addChild(this.bgTxt)):"downArrow1"==b&&(this.bgTxt=new BgTxt,this.bgTxt.updateTxt("\u7ec3\u4f1a\u4e5d\u9633\u795e\u529f\uff0c\u6211\u5c31\u662f\u4e1c\u65b9\u4e0d\u8d25,\u513f\u5b59\u904d\u5929\u4e0b\u554a\uff0c\u7ec3\u7ec3\u7ec3\uff01\uff01\uff01\u3002"), this.bgTxt.x=-320,this.bgTxt.y=175,this.addChild(this.bgTxt))}__extends(b,c);b.prototype.play=function(b){"leftArrow"==this.lefta?this.upState?(this.arrow.x+=15,this.upState=!1):(this.arrow.x-=15,this.upState=!0):this.upState?(this.arrow.y+=15,this.upState=!1):(this.arrow.y-=15,this.upState=!0)};return b}(egret.Sprite);ArrowBtn.prototype.__class__="ArrowBtn"; var ShareUtils=function(){function c(){}c.moreGame=function(){var b=window.navigator.userAgent;-1!=b.indexOf("EgretRuntime")&&-1!=b.indexOf("yoyo")?location.href="u9time://gamelist":window.open("http://m.2144.cn/h5","_self")};c.shareToWeChat=function(){window.WeixinApi&&WeixinApi.ready(function(b){var d=new WeixinShareInfo;d.title=c.shareTitle;d.desc=c.shareDesc;d.link=c.doUrl();d.imgUrl=c.shareImgUrl;b.shareToFriend(d);b.shareToTimeline(d)})};c.doUrl=function(){var b=c.findLocationProperty("uId"); c.findLocationProperty("chn");b=window.location.href;return c.shareUrl=b};c.shareToU9=function(){var b=location.href,b=encodeURIComponent(b),d=c.shareDesc,a=c.getUid(),e="u9time://share?uid="+a+"&game_url="+b+"&a=123&msg="+d;a||(e="u9time://share?&game_url="+b+"&a=123&msg="+d);location.href=e};c.setShareInfo=function(b,d,a){c.shareTitle=b;c.shareDesc=d;c.shareImgUrl=a;c.shareToWeChat()};c.isInWeChat=function(){return!!window.WeixinJSBridge};c.findLocationProperty=function(b){var c= location.search;if(""==c)return null;var c=c.slice(1),c=c.split("&"),a=c.length;console.log("searchArr",c);for(var e=0;eb.localX&&120b.localY&&(this.houseClick(null),this.house.touchBegin(null))};b.prototype.homeEnd=function(b){this.house.touchEnabled&&this.house.touchEnd(null)};b.prototype.houseClick=function(b){this.clickNum++;5==this.clickNum&&(this.upArrow.visible=!1,TaskManager.instance().startTask()); RoleManager.instance().addRoleToStage();SoundManager.instance().playHouseClick();b=HouseManager.instance().getAddNumByClick();DataManager.instance().addByClickHouse(b);this.playAlphaTxt(b)};b.prototype.playAlphaTxt=function(c){var a;a=0==b.alphaTxtPool.length?new AlphaTxt:b.alphaTxtPool.pop();a.text="+"+c;a.alpha=1;a.x=268;a.y=178;this.addChild(a);a.update()};b.recycleTxt=function(c){b.alphaTxtPool.push(c)};b.prototype.showDownArrow=function(){this.updateTipsView("\u867d\u7136\u6761\u4ef6\u8270\u82e6\uff0c\n\u4f46\u4e0d\u5f71\u54cd\u6211\u6fc0\u60c5\u7684\u5fc3\u54e6\uff01\n\n\u5929\u82cd\u82cd\uff0c\n\u91ce\u832b\u832b\u3002\n\u98ce\u5439\u8349\u4f4e\uff0c\n\u767d\u82b1\u82b1\u3002", "\u5f00\u59cb\u5efa\u9020",2);GKManager.instance().hasClickDown?TaskManager.instance().goTaskFromPause():(this.gk1.addBtn.visible=!0,this.downArrow.visible=!0,this.house.touchEnabled=!1)};b.prototype.closeDownArrow=function(){this.downArrow.visible=!1;this.downArrow.dTimer.stop();TaskManager.instance().currentTaskIndex==TaskManager.instance().ydArr[1]&&(this.house.touchEnabled=!0,TaskManager.instance().goTaskFromPause())};b.prototype.showDownArrow1=function(){GKManager.instance().hasClickDown1?TaskManager.instance().goTaskFromPause(): (this.gk2.addBtn.visible=!0,this.downArrow1.visible=!0,this.house.touchEnabled=!1)};b.prototype.closeDownArrow1=function(){this.downArrow1.visible=!1;this.downArrow1.dTimer.stop();TaskManager.instance().currentTaskIndex==TaskManager.instance().ydArr[2]&&(this.house.touchEnabled=!0,TaskManager.instance().goTaskFromPause())};b.prototype.showLeftArrow=function(){this.updateTipsView("\u54e5\u4ece\u524d\u4e00\u76f4\u4e0d\u660e\u767d\uff0c\u4e3a\u5565\u53e4\u4eba\u7ba1\u8001\u5a46\u53eb\u5927\u623f\u3001\u4e8c\u623f\u3001\u4e09\u623f...\n\n\u5982\u4eca\u771f\u7684\u61c2\u4e86\uff0c\u5176\u5b9e\u6211\u4eec\u662f\u4e00\u623f\u4e00\u59bb\u5236\u3002\n\n\u65e0\u623f\u5c31\u65e0\u59bb\uff0c\u591a\u623f\u5c31\u591a\u59bb\u3002\u53e4\u4eba\u8bda\u4e0d\u6211\u6b3a\u4e5f...", "\u8305\u5c4b\u53d8\u8c6a\u5b85",1);GKManager.instance().hasClickLeftArrow?TaskManager.instance().goTaskFromPause():(this.leftArrow.visible=!0,this.house.touchEnabled=!1)};b.prototype.closeLeftArrow=function(){this.leftArrow.visible=!1;this.leftArrow.dTimer.stop();TaskManager.instance().currentTaskIndex==TaskManager.instance().ydArr[0]&&(this.house.touchEnabled=!0,TaskManager.instance().goTaskFromPause())};b.prototype.updateTipsView=function(b,a,c){GameContent.me.tipsView.visible=!0;GameContent.me.tipsView.updateTxtAndBtn(b, a,c)};b.prototype.youhua=function(){this.gk3.visible=this.y+this.gk3.y+80>Consts.Game_Height?!1:!0;this.gk3.addBtn.visible=!1};b.alphaTxtPool=[];return b}(egret.Sprite);GameLayer.prototype.__class__="GameLayer"; var DataManager=function(){function c(){this.allGKAdd=this.gk4Add=this.gk3Add=this.gk2Add=this.gk1Add=this.currentTotal=0;this.jc=1;this.fxJc=0;if(null!=c._instance)throw Error("singleton");}c.instance=function(){return null==this._instance?this._instance=new c:this._instance};c.prototype.restart=function(){this.stopAutoAdd();this.currentTotal=this.jc=this.allGKAdd=this.gk4Add=this.gk3Add=this.gk2Add=this.gk1Add=0;this.gameTitle.updateSonTxt(this.currentTotal);this.gameTitle.updateDCL(this.allGKAdd); this.gameTitle.updateJC(this.jc);TaskManager.instance().updateDcl(this.allGKAdd);this.updateJC(this.fxJc,!0)};c.prototype.updateGKData=function(b){switch(b[0]){case GKConsts.GK1:this.gk1Add=b[1];break;case GKConsts.GK2:this.gk2Add=b[1];break;case GKConsts.GK3:this.gk3Add=b[1];break;case GKConsts.GK4:this.gk4Add=b[1]}this.allGKAdd=this.gk1Add+this.gk2Add+this.gk3Add+this.gk4Add;b=TaskManager.instance().fxjs*ShareUtils.help;this.allGKAdd=this.allGKAdd*b+this.allGKAdd+this.allGKAdd*(this.jc-1);this.gameTitle.updateDCL(this.allGKAdd); TaskManager.instance().updateDcl(this.allGKAdd)};c.prototype.updateJC=function(b,c){"undefined"===typeof c&&(c=!1);this.jc=c?this.fxJc:b+this.fxJc;this.allGKAdd=this.gk1Add+this.gk2Add+this.gk3Add+this.gk4Add;this.allGKAdd*=this.jc;this.gameTitle.updateDCL(this.allGKAdd);this.gameTitle.updateJC(this.jc);TaskManager.instance().updateDcl(this.allGKAdd)};c.prototype.addByClickHouse=function(b){this.currentTotal+=b;TaskManager.instance().updateCurrentNum(b)};c.prototype.startAutoAdd=function(){egret.Ticker.getInstance().register(this.autoAdd, this)};c.prototype.stopAutoAdd=function(){egret.Ticker.getInstance().unregister(this.autoAdd,this)};c.prototype.autoAdd=function(b){this.currentTotal+=b/1E3*this.allGKAdd;this.gameTitle.updateSonTxt(this.currentTotal);!0==GameContent.me.itemLayer.buyView.visible&&(b=Math.floor(this.currentTotal),GKManager.instance().buyCurrent=b,GameContent.me.itemLayer.buyView.currentLb.text=GKConsts.GK_CurrentTxt+NumUtils.numToString(b)+"\u5b50\u5b59")};return c}();DataManager.prototype.__class__="DataManager"; var RoleFactory=function(){function c(){if(null!=c._instance)throw Error("singleton");}c.getInstance=function(){return null==this._instance?this._instance=new c:this._instance};c.getRole=function(b,c){return new Role(b,c)};c.prototype.getRoleImgArrByType=function(b){var c=[];switch(b){case RoleType.PT:c=["30002_1","30002_2","30002_3","30002_4","30001_1"];break;case RoleType.BIG:c=["30003_1","30003_2","30001_1"];break;case RoleType.QUN:c=["30100_1","30100_2","30100_3"];break;case RoleType.DOG:c=["30200_1", "30200_2","30200_3"];break;case RoleType.BUS:c=["30300_1","30300_2","30300_3"]}return c};return c}();RoleFactory.prototype.__class__="RoleFactory"; var RoleManager=function(){function c(){this.stageRolePool=[];this.ptRolePool=[];this.bigRolePool=[];this.qunRolePool=[];this.busRolePool=[];this.dogRolePool=[];this.houseLv=this.totalLv=0;if(null!=c._instance)throw Error("singleton");}c.instance=function(){return null==this._instance?this._instance=new c:this._instance};c.prototype.restart=function(){this.stopAutoTimer();this.autoTimer.reset();this.houseLv=this.totalLv=0};c.prototype.startAutoTimer=function(b){"undefined"===typeof b&&(b=!1);if(b)for(;this.stageRolePool[0];)this.recycle(this.stageRolePool[0]); this.autoTimer||(this.autoTimer=new egret.Timer(500,0),this.autoTimer.addEventListener(egret.TimerEvent.TIMER,this.autoCreateRole,this));this.autoTimer.reset();this.autoTimer.start()};c.prototype.autoCreateRole=function(b){0this.tsIcon.need?(DataManager.instance().currentTotal=DataManager.instance().currentTotal-this.tsIcon.need,HouseManager.instance().setHouseLv(this.tsIcon.index),DataManager.instance().updateJC(this.tsIcon.jc),this["icon"+this.tsIcon.index].updateIcon(HouseType["H"+this.tsIcon.index+"_ICON"],!1,!0),4>this.tsIcon.index?(this.tsIcon=this["icon"+(this.tsIcon.index+1)],this.updateView(this.tsIcon.need,this.tsIcon.title,this.tsIcon.desc), this.tsIcon.updateIcon(HouseType["H"+this.tsIcon.index+"_ICON"],!0,!1),this.currentIcon=this.tsIcon):this.tsIcon=null):this.shanState?(this.needTxt.textColor=16711680,this.shanState=!1):(this.needTxt.textColor=0,this.shanState=!0))};return b}(TipsBaseView);BuyHouseView.prototype.__class__="BuyHouseView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},BuyView=function(c){function b(){c.call(this);this.init()}__extends(b,c);b.prototype.init=function(){this.icon=new egret.Bitmap;this.icon.x=10;this.icon.y=-55;this.addChild(this.icon);this.lb=new egret.TextField;this.lb.x=125;this.lb.y=30;this.lb.size=20;this.lb.textColor=0;this.lb.text="\u8349\u4e1b";this.addChild(this.lb);this.line= ResourceUtils.createBitmapByName("mask");this.line.width=Consts.Game_Width-100;this.line.height=4;this.line.x=25;this.line.y=60;this.addChild(this.line);this.needLb=new egret.TextField;this.needLb.x=20;this.needLb.y=90;this.needLb.size=20;this.needLb.text="\u9700\u8981\u5b50\u5b59\uff1a";this.needLb.textColor=0;this.addChild(this.needLb);this.currentLb=new egret.TextField;this.currentLb.x=20;this.currentLb.y=135;this.currentLb.size=20;this.currentLb.text="\u5f53\u524d\u5b50\u5b59\uff1a";this.currentLb.textColor= 0;this.addChild(this.currentLb);this.desTxt=new egret.TextField;this.desTxt.x=20;this.desTxt.y=180;this.desTxt.size=20;this.desTxt.width=340;this.desTxt.height=80;this.desTxt.text="\u4eba\u7c7b\u6587\u660e\u59cb\u4e8e\u8349\u4e1b\u3002";this.desTxt.textColor=0;this.addChild(this.desTxt);this.buyBtn=new TxtBtn("\u7acb\u523b\u732e\u796d",8947848,3355443);console.log(Consts.Game_Width-100-155);this.buyBtn.x=177;this.buyBtn.y=245;this.addChild(this.buyBtn);this.closeBtn=new ImgBtn("40040_1","40040_2", "btnRes");this.closeBtn.x=Consts.Game_Width-60;this.closeBtn.y=10;this.addChild(this.closeBtn);this.drawBorder(Consts.Game_Width-50,310,15658734)};b.prototype.updateView=function(b,a,c,l,n){this.icon.texture=ResourceUtils.getTextureFromSheet(b,"gkRes");this.lb.text=a;this.needLb.text=c;this.currentLb.text=l;this.desTxt.text=n};return b}(TipsBaseView);BuyView.prototype.__class__="BuyView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TaskFailView=function(c){function b(){c.call(this);this.init()}__extends(b,c);b.prototype.init=function(){this.tiyanX1=ResourceUtils.createBitmapByName("tyx");this.tiyanX1.x=110;this.tiyanX1.y=448;this.addChild(this.tiyanX1);this.tiyanX2=ResourceUtils.createBitmapByName("tyx");this.tiyanX2.x=400;this.tiyanX2.y=445;this.addChild(this.tiyanX2); this.titleTxt=new egret.TextField;this.titleTxt.textColor=0;this.titleTxt.width=520;this.titleTxt.y=23;this.titleTxt.text="\u5931 \u8d25";this.titleTxt.textAlign="center";this.addChild(this.titleTxt);this.titleLb=new egret.TextField;this.titleLb.x=20;this.titleLb.y=80;this.titleLb.textColor=0;this.titleLb.size=20;this.titleLb.text=TaskConsts.CH;this.lsLb=new egret.TextField;this.lsLb.y=80;this.lsLb.x=35;this.lsLb.text=TaskConsts.LS;this.lsLb.textColor=0;this.lsLb.size=20;this.addChild(this.lsLb); this.smTxt=new egret.TextField;this.smTxt.x=33;this.smTxt.y=130;this.smTxt.textColor=0;this.smTxt.size=20;this.smTxt.width=480;this.smTxt.height=40;this.smTxt.text=TaskConsts.SM;this.addChild(this.smTxt);this.restartBtn=new TxtBtn(TaskConsts.ZLYC,8947848,3355443);this.restartBtn.x=40;this.restartBtn.y=180;this.restartBtn.touchEnabled=!0;this.addChild(this.restartBtn);this.qzBtn=new TxtBtn("\u5206\u4eab\u670b\u53cb\u5708",8947848,3355443);this.qzBtn.x=Consts.Game_Width-100-151;this.qzBtn.y=180;this.qzBtn.touchEnabled= !0;this.addChild(this.qzBtn);this.icon=new egret.Bitmap;this.icon.x=25;this.icon.y=265;this.icon.width=100;this.icon.height=100;this.addChild(this.icon);this.descTxt=new BorderTxt(330,120,5592405,1);this.descTxt.x=150;this.descTxt.y=255;this.descTxt.textColor=0;this.descTxt.size=20;this.addChild(this.descTxt);this.drawBorder(Consts.Game_Width-50,370,15658734);this.bp.height=450;this.setChildIndex(this.tiyanX1,0);this.setChildIndex(this.tiyanX2,0);this.tiyanK=ResourceUtils.createBitmapByName("tyk"); this.tiyanK.y=470;this.addChild(this.tiyanK);this.tiyanW=ResourceUtils.createBitmapByName("tyw");this.tiyanW.x=190;this.tiyanW.y=497;this.addChild(this.tiyanW);this.andrb=new TxtBtn("2144\u6e38\u620f",8947848,3355443);this.andrb.x=190;this.andrb.y=541;this.andrb.touchEnabled=!0;this.addChild(this.andrb);this.arrow=new LastArrow("jiantou");this.arrow.x=235;this.arrow.y=390;this.addChild(this.arrow)};b.prototype.updateTxt=function(b,a,c){this.titleLb.text=TaskConsts.CH+b;var l;switch(TaskManager.instance().currentTask.index){case 1:l= 0+20*Math.random();break;case 2:l=20+20*Math.random();break;case 3:l=40+20*Math.random();break;case 4:l=60+20*Math.random();break;case 5:l=80+20*Math.random();break;default:l=100*Math.random()}l=Math.floor(l);a=NumUtils.numToString(a);this.shareTxts="\u5df2\u7ecf\u7e41\u6b96\u4e86"+a+"\u4e2a\u5b50\u5b59\uff0c\u6210\u4e3a\u4e86"+b+"\uff0c\u51fb\u8d25\u4e86\u5168\u7403"+l+"%\u7684\u4eba";this.shareTxt="\u5df2\u7ecf\u7e41\u6b96\u4e86"+a+"\u4e2a\u5b50\u5b59\uff0c\u6210\u4e3a\u4e86"+b+"\uff0c\u51fb\u8d25\u4e86\u5168\u7403"+ l+"%\u7684\u4eba";this.descTxt.text="\u751f\u5b69\u5b50\u7d2f\u4e86\uff0c\u73a9\u70b9\u522b\u7684\u4f11\u606f\u4e0b\u54c8\uff01";this.icon.texture=ResourceUtils.getTextureFromSheet(c,"taskIconRes")};b.prototype.updateLS=function(b){this.lsLb.text=TaskConsts.LS+b+" \u5b50\u5b59"};return b}(TipsBaseView);TaskFailView.prototype.__class__="TaskFailView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TaskFinishView=function(c){function b(){c.call(this);this.init()}__extends(b,c);b.prototype.init=function(){this.titleTxt=new egret.TextField;this.titleTxt.textColor=0;this.titleTxt.width=520;this.titleTxt.y=25;this.titleTxt.text="\u76ee\u6807\u8fbe\u6210";this.titleTxt.textAlign="center";this.addChild(this.titleTxt);this.targetTxt= new egret.TextField;this.targetTxt.x=50;this.targetTxt.y=75;this.targetTxt.size=20;this.targetTxt.textColor=0;this.addChild(this.targetTxt);this.icon=new egret.Bitmap;this.icon.x=20;this.icon.y=120;this.icon.width=100;this.icon.height=100;this.addChild(this.icon);this.desc=new BorderTxt(330,120,0,1);this.desc.x=140;this.desc.y=115;this.desc.size=20;this.desc.textColor=0;this.addChild(this.desc);this.chTxt=new egret.TextField;this.chTxt.width=420;this.chTxt.size=20;this.chTxt.textColor=0;this.chTxt.y= 260;this.chTxt.x=50;this.addChild(this.chTxt);this.btn=new TxtBtn("\u7ee7\u7eed\u6e38\u620f",0,0);this.btn.x=190;this.btn.y=290;this.addChild(this.btn);this.drawBorder(520,100,0,1);this.bp.height=365};b.prototype.updateTxt=function(b,a,c,l){this.chTxt.text="\u83b7\u5f97\u79f0\u53f7\uff1a"+b;this.desc.text=a;this.icon.texture=ResourceUtils.getTextureFromSheet(c,"taskIconRes");this.targetTxt.text="\u65b0\u7684\u76ee\u6807\uff1a \u7e41\u6b96 "+l+" \u5b50\u5b59"};return b}(TipsBaseView); TaskFinishView.prototype.__class__="TaskFinishView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TaskStartView=function(c){function b(){c.call(this);this.init()}__extends(b,c);b.prototype.init=function(){this.titleTxt=new egret.TextField;this.titleTxt.textColor=0;this.titleTxt.width=520;this.titleTxt.y=25;this.titleTxt.text="\u5f00\u64b8\u5427\uff01\u5fb7\u739b\u897f\u4e9a";this.titleTxt.textAlign="center";this.addChild(this.titleTxt); this.icon=new egret.Bitmap;this.icon.x=20;this.icon.y=80;this.icon.width=100;this.icon.height=100;this.addChild(this.icon);this.desc=new BorderTxt(330,120,0,1);this.desc.x=140;this.desc.y=85;this.desc.size=20;this.desc.textColor=0;this.addChild(this.desc);this.targetTxt=new egret.TextField;this.targetTxt.x=50;this.targetTxt.y=235;this.targetTxt.size=20;this.targetTxt.textColor=0;this.addChild(this.targetTxt);this.btn=new TxtBtn("\u53d1\u5c04",0,0);this.btn.x=190;this.btn.y=285;this.addChild(this.btn); this.drawBorder(520,100,0,1);this.bp.height=365};b.prototype.updateTxt=function(b,a,c){this.targetTxt.text="\u76ee\u6807\uff1a \u7e41\u6b96 "+b+" \u5b50\u5b59";this.desc.text=a;this.icon.texture=ResourceUtils.getTextureFromSheet(c,"taskIconRes")};return b}(TipsBaseView);TaskStartView.prototype.__class__="TaskStartView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TaskView=function(c){function b(){c.call(this);this.init()}__extends(b,c);b.prototype.init=function(){this.bg=ResourceUtils.createBitmapByName("taskbj");this.bg.width=530;this.bg.y=-60;this.bg.height=200;this.addChild(this.bg);this.icon=new egret.Bitmap;this.icon.y=-145;this.icon.x=-48;this.addChild(this.icon);this.txt=new egret.TextField; this.txt.textColor=0;this.txt.x=200;this.txt.y=-25;this.txt.textAlign="left";this.txt.lineSpacing=10;this.txt.size=22;this.txt.height=100;this.txt.width=320;this.addChild(this.txt);this.txt2=new egret.TextField;this.txt2.textColor=0;this.txt2.x=200;this.txt2.y=45;this.txt2.textAlign="left";this.txt2.size=28;this.txt2.text="\u76ee\u6807\uff1a";this.addChild(this.txt2);this.touchEnabled=!0;this.targetTxt=new egret.TextField;this.targetTxt.textColor=16711680;this.targetTxt.x=275;this.targetTxt.y=45; this.targetTxt.size=28;this.addChild(this.targetTxt)};b.prototype.update=function(b,a,c){this.touchEnabled=!1;this.icon.texture=ResourceUtils.getTextureFromSheet(b,"taskIconRes");this.txt.text=a;this.targetTxt.text=c;egret.setTimeout(this.setTouchAble,this,2E3)};b.prototype.setTouchAble=function(){this.touchEnabled=!0};return b}(egret.Sprite);TaskView.prototype.__class__="TaskView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},ItemLayer=function(c){function b(){c.call(this);this.init();this.touchEnabled=!0}__extends(b,c);b.prototype.init=function(){this.width=Consts.Game_Width;this.height=Consts.Game_Height;this.maskBj=ResourceUtils.createBitmapByName("mask");this.maskBj.width=this.width;this.maskBj.height=this.height+230;this.maskBj.alpha=0.7;this.maskBj.visible= !1;this.addChild(this.maskBj);this.buyView=new BuyView;this.buyView.x=25;this.buyView.y=300;this.buyView.visible=!1;this.addChild(this.buyView);this.buyHouseView=new BuyHouseView;this.buyHouseView.x=25;this.buyHouseView.y=300;this.buyHouseView.visible=!1;this.addChild(this.buyHouseView)};b.prototype.drawBJ=function(){this.graphics.clear()};b.prototype.updateTxt=function(b,a,c,l,n){this.drawBJ();this.maskBj.visible=!0;this.buyHouseView.visible=!1;this.buyView.visible=!0;this.buyView.icon.texture=ResourceUtils.getTextureFromSheet(b); this.buyView.lb.text=a;this.buyView.needLb.text=c;this.buyView.currentLb.text=l;this.buyView.desTxt.text=n};b.prototype.showBuyHouseView=function(){this.visible=!0;this.maskBj.visible=!0;this.buyHouseView.visible=!0;this.buyView.visible=!1};b.prototype.showBuyView=function(){this.visible=!0;this.maskBj.visible=!0;this.buyHouseView.visible=!1;this.buyView.visible=!0};b.prototype.closeView=function(){this.visible=!1;this.maskBj.visible=!1};b.prototype.restart=function(){this.buyHouseView.resetIcon()}; return b}(egret.Sprite);ItemLayer.prototype.__class__="ItemLayer"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},MCLayer=function(c){function b(){c.call(this);this.s=this.pt=0;this.ss=!0;this.st=0;this.stepTime=10;this.stepDif=this.stepCurrentTime=0;this.init();b.me=this}__extends(b,c);b.prototype.init=function(){this.targetTxt=new egret.TextField;this.addChild(this.targetTxt);this.timeTxt=new egret.TextField;this.addChild(this.timeTxt)};b.prototype.updateTxt= function(b,a){this.visible=!0;this.targetTxt.text="\u65f6\u95f4\uff1a"+a.toString();this.timeTxt.text="\u76ee\u6807\uff1a"+b.toString();this.play()};b.prototype.play=function(){this.targetTxt.textColor=5592405;this.targetTxt.size=20;this.targetTxt.alpha=0;this.targetTxt.x=150;this.targetTxt.y=240;this.timeTxt.textColor=5592405;this.timeTxt.size=20;this.timeTxt.alpha=0;this.timeTxt.x=280;this.timeTxt.y=240;egret.Ticker.getInstance().register(this.playing1,this)};b.prototype.playing1=function(b){this.pt+= b;30=this.stepTime&&(this.stepDif=this.stepCurrentTime=0,egret.Ticker.getInstance().unregister(this.playing3,this),this.stop()))};b.prototype.stop=function(){this.visible=!1;GameContent.me.gameTitle.ssTargetTxt();TaskManager.instance().currentTaskIndex==TaskManager.instance().ydArr[0]?(GameContent.me.gameLayer.house.touchEnabled=!1,GameContent.me.gameLayer.showLeftArrow()):TaskManager.instance().currentTaskIndex== TaskManager.instance().ydArr[1]?(GameContent.me.gameLayer.house.touchEnabled=!1,GameContent.me.gameLayer.showDownArrow()):TaskManager.instance().currentTaskIndex==TaskManager.instance().ydArr[2]?(GameContent.me.gameLayer.house.touchEnabled=!1,GameContent.me.gameLayer.showDownArrow1()):(TaskManager.instance().goTaskFromPause(),GameContent.me.gameLayer.house.touchEnabled=!0)};return b}(egret.Sprite);MCLayer.prototype.__class__="MCLayer"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TaskLayer=function(c){function b(){c.call(this);this.init();this.touchEnabled=!0}__extends(b,c);b.prototype.init=function(){this.width=Consts.Game_Width;this.height=Consts.Game_Height;this.maskBj=ResourceUtils.createBitmapByName("mask");this.maskBj.width=this.width;this.maskBj.height=this.height+230;this.maskBj.alpha=0.5;this.maskBj.visible= !1;this.addChild(this.maskBj);this.taskView=new TaskView;this.taskView.x=20;this.taskView.y=320;this.addChild(this.taskView);this.taskFailView=new TaskFailView;this.taskFailView.x=25;this.taskFailView.y=105;this.taskFailView.visible=!1;this.addChild(this.taskFailView);this.showTimer1=new egret.Timer(100,10);this.showTimer1.addEventListener(egret.TimerEvent.TIMER,this.playShow,this)};b.prototype.playShow=function(b){this.alpha+=0.1;1<=this.alpha&&(this.showTimer1.stop(),this.showTimer1.reset(),this.alpha= 1)};b.prototype.showStartView=function(b,a,c){this.showTimer1.stop();this.showTimer1.reset();this.visible=!0;this.maskBj.visible=!0;this.alpha=0;this.taskView.visible=!0;this.taskFailView.visible=!1;this.taskView.update(c,a,b);this.showTimer1.start()};b.prototype.showFinishTxt=function(b,a,c,l){this.showTimer1.stop();this.showTimer1.reset();this.visible=!0;this.maskBj.visible=!0;this.alpha=0;this.taskView.update(c,a,l);this.showTimer1.start()};b.prototype.showFailTxt=function(b,a,c){this.showTimer1.stop(); this.showTimer1.reset();this.visible=!0;this.maskBj.visible=!0;this.alpha=0;this.taskView.visible=!1;this.taskFailView.visible=!0;this.taskFailView.updateTxt(b,a,c);this.showTimer1.start()};b.prototype.restart=function(){this.showTimer1.stop();this.showTimer1.reset();this.visible=this.maskBj.visible=!1;this.alpha=0;this.taskFailView.visible=!1};return b}(egret.Sprite);TaskLayer.prototype.__class__="TaskLayer"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},ScrollView=function(c){function b(){c.call(this);this._downContainerY=this._downContainerX=0;this._deltaTime=200;this.direction=Direction.VERTICAL;this.touchEnabled=!0;this._containerY=this._containerX=0;this.mask=new egret.Rectangle(0,0,100,100);b.srollView=this}__extends(b,c);b.prototype._onAddToStage=function(){c.prototype._onAddToStage.call(this); this.addListeners()};b.prototype._onRemoveFromStage=function(){c.prototype._onRemoveFromStage.call(this);this.removeListeners()};Object.defineProperty(b.prototype,"width",{set:function(b){this._viewWidth=this._explicitWidth=b;this.mask.width=b},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,"height",{set:function(b){this._viewHeight=this._explicitHeight=b;this.mask.height=b},enumerable:!0,configurable:!0});b.prototype.setContainer=function(b,a,c){this._container&&this._container.parent&& this._container.parent.removeChild(this._container);this._container=b;this._initWidth=a;this._initHeight=c;this._containerY=this._containerX=0;if(null!=this._container.parent)if(this._container.parent!=this)this._container.parent.removeChild(this._container);else return;this.addChildAt(this._container,0)};b.prototype.mouseDown=function(b){this.touchEnabled&&null!=this._container&&(this._isMoved=!1,egret.MainContext.instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.mouseUp,this),egret.MainContext.instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.mouseUp,this),egret.MainContext.instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.mouseMove,this),egret.Tween.removeTweens(this._container),this._downContainerX=this._container.x,this._downContainerY=this._container.y,this._containerX=this._container.x,this._containerY=this._container.y,this._downPX=b.stageX,this._downPY=b.stageY,this._downTime=egret.getTimer())};b.prototype.mouseUp=function(b){console.log("this._containerY1::::",this._containerY);egret.MainContext.instance.stage.removeEventListener(egret.TouchEvent.TOUCH_END, this.mouseUp,this);egret.MainContext.instance.stage.removeEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.mouseUp,this);egret.MainContext.instance.stage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.mouseMove,this);var a=egret.getTimer();if(!(800>a-this._downTime))if(a-this._downTime>this._deltaTime)this._backToPosition();else{var c=b.stageX-this._downPX;b=b.stageY-this._downPY;a=2*Math.floor(this._deltaTime/(a-this._downTime));if(this.direction==Direction.BOTH||this.direction==Direction.HORIZONTAL)this._containerX+= c*a;if(this.direction==Direction.BOTH||this.direction==Direction.VERTICAL)this._containerY+=b*a;c=Math.max(100*a,100);c=Math.min(c,300);this.fixBoundary();a=egret.Tween.get(this._container,{onChange:this.moveList,onChangeObj:this});a.to({x:this._containerX,y:this._containerY},c);a.call(this._backToPosition,this);console.log("this._containerY::::",this._containerY)}};b.prototype.mouseMove=function(b){var a=b.stageX-this._downPX;b=b.stageY-this._downPY;if(this.direction==Direction.BOTH||this.direction== Direction.HORIZONTAL)this._containerX=this._downContainerX+a;if(this.direction==Direction.BOTH||this.direction==Direction.VERTICAL)this._containerY=this._downContainerY+b;this.fixBoundary();this._container.x=this._containerX;this._container.y=this._containerY;this.moveList()};b.prototype._backToPosition=function(){var b=!1;0=this._initWidth?0:this._viewWidth-this._initWidth); 0=this._initHeight?0:this._viewHeight-this._initHeight);b&&egret.Tween.get(this._container,{onChange:this.moveList,onChangeObj:this}).to({x:this._containerX,y:this._containerY},200)};b.prototype.fixBoundary=function(b){"undefined"===typeof b&&(b=0);0= this._initWidth?0:this._viewWidth-this._initWidth);0=this._initHeight?0:this._viewHeight-this._initHeight)};b.prototype.moveList=function(){this._container.youhua()};b.prototype.addListeners=function(){this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.mouseDown,this)};b.prototype.removeListeners=function(){this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.mouseDown, this);egret.MainContext.instance.stage.removeEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.mouseUp,this);egret.MainContext.instance.stage.removeEventListener(egret.TouchEvent.TOUCH_END,this.mouseUp,this);egret.MainContext.instance.stage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.mouseMove,this)};return b}(egret.DisplayObjectContainer);ScrollView.prototype.__class__="ScrollView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},TipsView=function(c){function b(){c.call(this);this.init()}__extends(b,c);b.prototype.init=function(){this.width=Consts.Game_Width;this.height=Consts.Game_Height;this.maskBj=ResourceUtils.createBitmapByName("mask");this.maskBj.width=this.width;this.maskBj.height=this.height+230;this.maskBj.alpha=0.7;this.addChild(this.maskBj);this.tipsBJ= new TipsBaseView;this.tipsBJ.drawBorder(Consts.Game_Width-50,370,15658734);this.tipsBJ.bp.height=500;this.tipsBJ.bp.width=370;this.tipsBJ.x=103;this.tipsBJ.y=75;this.addChild(this.tipsBJ);this.yxsm=new egret.TextField;this.yxsm.textColor=16711680;this.yxsm.x=133;this.yxsm.y=115;this.yxsm.size=22;this.yxsm.text="\u6e38\u620f\u8bf4\u660e";this.addChild(this.yxsm);this.txt=new egret.TextField;this.txt.textColor=0;this.txt.width=300;this.txt.x=133;this.txt.textAlign="left";this.txt.y=165;this.txt.size= 22;this.txt.lineSpacing=15;this.txt.text="\u70b9\u51fb\u8305\u5c4b\u5373\u53ef\u751f\u4ea7\u5b50\u5b59\uff0c\n\n\u751f\u4ea7\u66f4\u591a\u7684\u5b50\u5b59\u5360\u9886\u5168\u6751\u3001\u5168\u4e61\u3001\u5168\u53bf......\u76f4\u5230\u5236\u9738\u5168\u4e16\u754c\n\n\u7ed9\u6211\u4e00\u95f4\u8305\u5c4b\uff0c\u5c31\u80fd\u521b\u9020\u4e00\u4e2a\u6c11\u65cf\uff01";this.addChild(this.txt);this.jjb=new egret.TextField;this.jjb.text="\u8fdb\u51fb\u5427\uff01";this.jjb.size=25;this.jjb.y=450;this.jjb.x= 247;this.jjb.textColor=0;this.addChild(this.jjb);this.btn=new TxtBtn("\u5f00\u59cb\u751f\u4ea7",8947848,3355443);this.btn.x=205;this.btn.y=490;this.btn.touchEnabled=!0;this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.closeMe,this);this.addChild(this.btn)};b.prototype.closeMe=function(b){this.visible=!1;this.txt.text="";this.removeChild(this.btn);this.btn=null};b.prototype.updateTxtAndBtn=function(b,a,c,l){"undefined"===typeof l&&(l=!1);l?(this.yxsm.visible=!0,this.jjb.visible=!0):(1==c?(this.yxsm.visible= !1,this.jjb.visible=!1,this.txt.text=b,this.txt.width=300,this.txt.x=133,this.txt.textAlign="left",this.txt.y=130,this.txt.size=22,this.txt.lineSpacing=20):2==c&&(this.yxsm.visible=!1,this.jjb.visible=!1,this.txt.text=b,this.txt.width=300,this.txt.x=133,this.txt.textAlign="left",this.txt.y=130,this.txt.size=22,this.txt.lineSpacing=20),this.btn=new TxtBtn(a,8947848,3355443),this.btn.x=205,this.btn.y=490,this.btn.touchEnabled=!0,this.btn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.closeMe,this), this.addChild(this.btn))};return b}(TipsBaseView);TipsView.prototype.__class__="TipsView"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},GameContent=function(c){function b(){c.call(this);this.hasRestart=!1;this.init();b.me=this}__extends(b,c);b.prototype.init=function(){this.gameLayer=new GameLayer;this.scroller=new ScrollView;this.scroller.width=Consts.Game_Width;this.scroller.height=Consts.Game_Height;this.scroller.setContainer(this.gameLayer,Consts.Game_Width,this.gameLayer.height); this.scroller._onAddToStage();this.scroller.y=80;this.scroller.visible=!1;this.addChild(this.scroller);this.gameTitle=new TopView;this.gameTitle.visible=!1;this.addChild(this.gameTitle);this.itemLayer=new ItemLayer;this.itemLayer.visible=!1;this.addChild(this.itemLayer);this.taskLayer=new TaskLayer;this.taskLayer.visible=!1;this.addChild(this.taskLayer);this.mcLayer=new MCLayer;this.mcLayer.width=Consts.Game_Width;this.mcLayer.height=500;this.addChild(this.mcLayer);this.tipsView=new TipsView;this.addChild(this.tipsView); this.yd=new BaseBitmap(ResourceUtils.createBitmapByName("yindao"));this.yd.touchEnabled=!0;this.yd.addEventListener(egret.TouchEvent.TOUCH_TAP,this.closeYD,this);this.addChild(this.yd);this.registManager()};b.prototype.registManager=function(){GKManager.instance().itemLayer=this.itemLayer;GKManager.instance().gameLayer=this.gameLayer;RoleManager.instance().gameLayer=this.gameLayer;DataManager.instance().gameTitle=this.gameTitle;HouseManager.instance().house=this.gameLayer.house;TaskManager.instance().taskLayer= this.taskLayer;TaskManager.instance().gameTitle=this.gameTitle;SoundManager.instance().gameTitle=this.gameTitle;TaskManager.instance().initTaskManager();GKManager.instance().initGKManager();SoundManager.instance().init();this.scroller.height=egret.MainContext.instance.stage.stageHeight-80;Consts.Game_Height=egret.MainContext.instance.stage.stageHeight};b.prototype.startGame=function(b){"undefined"===typeof b&&(b=!1);RoleManager.instance().startAutoTimer(b);DataManager.instance().startAutoAdd()};b.prototype.startTask= function(){TaskManager.instance().startTask()};b.prototype.stopGame=function(){RoleManager.instance().stopAutoTimer();DataManager.instance().stopAutoAdd()};b.prototype.restart=function(){GKManager.instance().restart();RoleManager.instance().restart();HouseManager.instance().restart();DataManager.instance().restart();TaskManager.instance().restart();this.startGame(!0);TaskManager.instance().startTask();this.hasRestart=!0};b.prototype.closeYD=function(b){this.gameTitle.visible=!0;this.scroller.visible= !0;this.gameLayer.youhua();this.yd.parent&&this.removeChild(this.yd);this.startGame();SoundManager.instance().playBj()};return b}(egret.Sprite);GameContent.prototype.__class__="GameContent"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},CloudMask=function(c){function b(){c.call(this);this.goLeft=!0;this.step=2;this.init()}__extends(b,c);b.prototype.init=function(){this.cloud1=ResourceUtils.createBitmapByName("40085_png");this.cloud1.x=0;this.cloud1.y=0;this.cloud1.height=180;this.addChild(this.cloud1);this.cloud2=ResourceUtils.createBitmapByName("40085_png");this.cloud2.x= 640;this.cloud2.y=0;this.cloud2.height=180;this.addChild(this.cloud2);this.startWave()};b.prototype.startWave=function(){egret.Ticker.getInstance().register(this.wave,this)};b.prototype.wave=function(b){-640==this.cloud1.x?this.goLeft=!1:0==this.cloud1.x&&(this.goLeft=!0);this.goLeft?(this.cloud1.x-=this.step,this.cloud2.x-=this.step):(this.cloud1.x=0,this.cloud2.x=640)};b.prototype.dispose=function(){egret.Ticker.getInstance().register(this.wave,this)};return b}(egret.Sprite); CloudMask.prototype.__class__="CloudMask"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},LoadingUI=function(c){function b(){c.call(this);this.createView()}__extends(b,c);b.instance=function(){return null==b._instance?b._instance=new b:b._instance};b.prototype.addToStage=function(){egret.MainContext.instance.stage.addChild(this)};b.prototype.removeFromStage=function(){egret.MainContext.instance.stage.removeChild(this)};b.prototype.createView= function(){var b=new egret.Bitmap;b.texture=RES.getRes("egretLogo");b.scaleX=570/b.width;b.scaleY=1050/b.height;this.addChild(b);this.textField=new egret.TextField;this.addChild(this.textField);this.textField.size=26;this.textField.textColor=0;this.textField.x=0;this.textField.y=680;this.textField.textAlign=egret.HorizontalAlign.CENTER;this.textField.width=570;this.textField.height=100};b.prototype.playOverMovie=function(){this.textField.alpha=0;this.textField.text="Powered by Egret Engine";var b= egret.Tween.get(this.textField);b.to({alpha:1},1200);b.wait(400);b.to({alpha:0},700);b.call(this.allOver,this)};b.prototype.allOver=function(){Consts.GameApp.onLoadingAllOver()};b.prototype.onProgress=function(b,a){this.textField.text="\u6e38\u620f\u52a0\u8f7d\u4e2d..."+Math.ceil(b/a*100).toString()+"%"};return b}(egret.Sprite);LoadingUI.prototype.__class__="LoadingUI"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},ShareContainer=function(c){function b(b,a,e){c.call(this);this._shareTipLabel=new egret.TextField;this._shareContent=new egret.TextField;this._shareImg=new egret.Bitmap;var l=this;RES.getResByUrl("resource/assets/arrow.png",function(a){console.log(this);l._shareImg.texture=a},this)}__extends(b,c);b.prototype.showShareView=function(b){this.width= Consts.Game_Width;this.height=Consts.Game_Height;this.graphics.clear();this.graphics.beginFill(5592405,0.5);this.graphics.drawRect(0,0,this.width,this.height);this.graphics.endFill();this.touchEnabled=!0;this._shareImg.x=this.width-150;this._shareImg.y=0;this.addChild(this._shareImg);this._shareTipLabel.text="\u5206\u4eab\u5230\u670b\u53cb\u5708";this._shareTipLabel.y=60;this._shareTipLabel.x=200;this._shareTipLabel.size=25;this.addChild(this._shareTipLabel);this._shareContent.text=b;this._shareContent.x= 50;this._shareContent.y=250;this._shareContent.size=25;ShareUtils.shareToWeChat();this.addEventListener(egret.TouchEvent.TOUCH_TAP,this.removeShareContainer,this)};b.prototype.removeShareContainer=function(b){this.parent&&this.parent.removeChild(this)};return b}(egret.Sprite);ShareContainer.prototype.__class__="ShareContainer"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},GameApp=function(c){function b(){c.call(this);this.shareContainer=new ShareContainer;Consts.GameApp=this;this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this);ShareUtils.setShareInfo(Consts.title,Consts.desc,Consts.iconLink)}__extends(b,c);b.prototype.onAddToStage=function(b){Consts.Game_Width=570;Consts.Game_Height= 800;Consts.GamePoxY=0;this.shareContainer=new ShareContainer;RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this);RES.loadConfig("resource/resource.json","resource/")};b.prototype.onConfigComplete=function(b){RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this);RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this);RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS,this.onResourceProgress,this);RES.loadGroup("loading")}; b.prototype.onLoadingAllOver=function(){this.stage.removeChild(this.loadingView);this.createGameScene()};b.prototype.onResourceLoadComplete=function(b){"preload"==b.groupName?(RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this),RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS,this.onResourceProgress,this),this.loadingView.playOverMovie()):"loading"==b.groupName&&(this.loadingView=new LoadingUI,this.stage.addChild(this.loadingView),RES.loadGroup("preload"))}; b.prototype.onResourceProgress=function(b){if("preload"==b.groupName)this.loadingView.onProgress(b.itemsLoaded,b.itemsTotal)};b.prototype.createGameScene=function(){this.gameContent=new GameContent;this.addChild(this.gameContent);ShareUtils.getUserGoal()};b.prototype.createBitmapByName=function(b){var a=new egret.Bitmap;b=RES.getRes(b);a.texture=b;return a};b.prototype.startAnimation=function(b){};b.prototype.shareGame=function(b){Consts.title="\u611a\u516c\u79fb\u5c71";Consts.desc=b;console.log("share:::", Consts.title,Consts.desc);ShareUtils.setShareInfo(Consts.title,Consts.desc,Consts.iconLink);ShareUtils.isInWeChat()&&(this.shareContainer.showShareView(Consts.desc),this.addChild(this.shareContainer))};b.prototype.moreGameBtnClick=function(){ShareUtils.moreGame()};return b}(egret.DisplayObjectContainer);GameApp.prototype.__class__="GameApp"; var __extends=this.__extends||function(c,b){function d(){this.constructor=c}for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a]);d.prototype=b.prototype;c.prototype=new d},GKView=function(c){function b(b,a){"undefined"===typeof a&&(a=!0);c.call(this);this.isSetMask=this.isShowTitle=!0;this.dcl=this.gkIndex=0;this.itemArr=[];this.roleArr=[];this.isShowTitle=this.isSetMask=a;this.initData();this.initView(b)}__extends(b,c);b.prototype.initData=function(){this.add=this.num=0;this.gkData=new GK};b.prototype.initView= function(b){this.bgImg=ResourceUtils.createBitmapByName(b);this.addChild(this.bgImg);this.isSetMask&&(this.titleTips=new TitleTips,this.titleTips.visible=!1,this.addChild(this.titleTips),this.cloudMask=new CloudMask,this.addChild(this.cloudMask));this.addBtn=new ImgBtn("40035_1","40035_2","btnRes");this.addBtn.x=530;this.addBtn.y=this.isSetMask?90:230;this.addChild(this.addBtn)};b.prototype.setTitleTip=function(b,a,c){this.titleTips.updateLb(b,a,c)};b.prototype.updateTitleTip=function(b,a){this.titleTips.updateTxt(b, a)};b.prototype.removeMask=function(){this.titleTips.visible=!0;this.cloudMask.visible=!1;this.tp=new egret.Point(270,55);this.bp=new egret.Point(260,65);this.homeRect=new egret.Rectangle(0,50,640,115)};b.prototype.updateData=function(){DataManager.instance().updateGKData([this.gkData.type,this.gkData.ADD]);this.titleTips.updateTxt(this.gkData.itemNum,this.gkData.ADD)};b.prototype.addItem=function(b,a){0==this.itemArr.length&&this.removeMask();9>this.itemArr.length&&(b.x=85*this.itemArr.length+5, b.y=35,this.addChild(b),this.itemArr.push(b));this.gkIndex++;this.gkData.currentIndex++;this.gkData.currentNeeds=this.gkData.list[this.gkIndex].need;this.gkData.itemNum=this.gkIndex;this.resetRole()};b.prototype.resetRole=function(){1==this.itemArr.length?this.addARole():5==this.itemArr.length?this.addARole():8==this.itemArr.length&&this.addARole();this.setChildIndex(this.addBtn,this.numChildren-1);this.gkData.ADD=this.gkData.list[this.gkIndex].add;this.titleTips.leftTxt.text=this.gkData.itemNum.toString(); this.updateData()};b.prototype.addARole=function(){var b=RoleManager.instance().createRole(RoleType.PT,RoleState.FLY);b.update(this.bp,this.tp,this.homeRect,b.roleType);b.isInHome=!1;this.roleArr.push(b);this.addChild(b)};b.prototype.setGKDisplay=function(b,a,c,l){this.gkData.type=b;this.gkData.itemIcon=a;this.gkData.title=c;this.gkData.desc=l};b.prototype.setGKData=function(){this.gkData.currentNeeds=this.gkData.list[0].need};b.prototype.restart=function(){this.isSetMask&&(this.cloudMask.visible= !0);this.gkIndex=0;this.gkData.currentIndex=0;this.gkData.currentNeeds=this.gkData.list[0].need;this.gkData.itemNum=0;this.gkData.ADD=this.gkData.list[0].add;for(this.updateData();this.itemArr[0];)this.removeChild(this.itemArr[0]),this.itemArr.shift();for(;this.roleArr[0];)this.removeChild(this.roleArr[0]),this.roleArr.shift()};return b}(egret.Sprite);GKView.prototype.__class__="GKView";var Task=function(){return function(){}}();Task.prototype.__class__="Task";