-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtimeobject.js
2 lines (2 loc) · 19.6 KB
/
runtimeobject.js
1
2
var gdjs;(function(n){const D=(x,e,t,i)=>{const s=Math.max(t,x-t),a=Math.max(i,e-i);return Math.pow(s,2)+Math.pow(a,2)},_={moveXArray:[],moveYArray:[]},C=(x,e,t)=>{if(e.length===0)return e.length=0,t.length=0,!1;if(e.length===1)return x.setPosition(x.getX()+e[0],x.getY()+t[0]),e.length=0,t.length=0,!0;let i=0,s=0;for(let m=0;m<e.length;m++){const A=e[m],d=t[m],y=A*A+d*d;y>i&&(i=y,s=m)}const a=Math.sqrt(i),r=e[s]/a,u=-(t[s]/a),g=r;let c=0,l=0;for(let m=0;m<e.length;m++){const A=e[m],d=t[m],y=A*u+d*g;c=Math.min(c,y),l=Math.max(l,y)}let f=e[s],v=t[s];const b=-c<l/1048576,p=l<-c/1048576;return b!==p&&(p?(f+=c*u,v+=c*g):(f+=l*u,v+=l*g)),x.setPosition(x.getX()+f,x.getY()+v),e.length=0,t.length=0,!0},o=class{constructor(e,t){this.x=0;this.y=0;this.angle=0;this.zOrder=0;this.hidden=!1;this.layer="";this._livingOnScene=!0;this.persistentUuid=null;this.pick=!1;this._defaultHitBoxes=[];this.hitBoxesDirty=!0;this.aabb={min:[0,0],max:[0,0]};this._rendererEffects={};this._forces=[];this._behaviors=[];this.getVariableNumber=o.getVariableNumber;this.returnVariable=o.returnVariable;this.getVariableString=o.getVariableString;this.setVariableNumber=o.setVariableNumber;this.setVariableString=o.setVariableString;this.getVariableBoolean=o.getVariableBoolean;this.setVariableBoolean=o.setVariableBoolean;this.toggleVariableBoolean=o.toggleVariableBoolean;this.variableChildExists=o.variableChildExists;this.variableRemoveChild=o.variableRemoveChild;this.variableClearChildren=o.variableClearChildren;this.variablePushCopy=o.variablePushCopy;this.valuePush=o.valuePush;this.variableRemoveAt=o.variableRemoveAt;this.getSqDistanceTo=o.prototype.getSqDistanceToPosition;this.name=t.name||"",this.type=t.type||"",this._nameId=o.getNameIdentifier(this.name),this.id=e.createNewUniqueId(),this._runtimeScene=e,this._defaultHitBoxes.push(n.Polygon.createRectangle(0,0)),this.hitBoxes=this._defaultHitBoxes,this._variables=new n.VariablesContainer(t?t.variables:void 0),this._averageForce=new n.Force(0,0,0),this._behaviorsTable=new Hashtable;for(let i=0;i<t.effects.length;++i)this._runtimeScene.getGame().getEffectsManager().initializeEffect(t.effects[i],this._rendererEffects,this),this.updateAllEffectParameters(t.effects[i]);for(let i=0,s=t.behaviors.length;i<s;++i){const a=t.behaviors[i],r=n.getBehaviorConstructor(a.type);this._behaviors.push(new r(e,a,this)),this._behaviorsTable.put(a.name,this._behaviors[i])}this._timers=new Hashtable}onCreated(){const e=this.getRendererObject();if(e)for(const t in this._rendererEffects)this._runtimeScene.getGame().getEffectsManager().applyEffect(e,this._rendererEffects[t]);for(let t=0;t<this._behaviors.length;++t)this._behaviors[t].onCreated()}reinitialize(e){const t=this._runtimeScene;this.x=0,this.y=0,this.angle=0,this.zOrder=0,this.hidden=!1,this.layer="",this._livingOnScene=!0,this.id=t.createNewUniqueId(),this.persistentUuid=null,this.pick=!1,this.hitBoxesDirty=!0,this.aabb.min[0]=0,this.aabb.min[1]=0,this.aabb.max[0]=0,this.aabb.max[1]=0,this._variables=new n.VariablesContainer(e.variables),this.clearForces(),this._behaviorsTable.clear();let i=0;for(const s=e.behaviors.length;i<s;++i){const a=e.behaviors[i],r=n.getBehaviorConstructor(a.type);i<this._behaviors.length?this._behaviors[i]=new r(t,a,this):this._behaviors.push(new r(t,a,this)),this._behaviorsTable.put(a.name,this._behaviors[i])}this._behaviors.length=i;for(let s=0;s<e.effects.length;++s)this._runtimeScene.getGame().getEffectsManager().initializeEffect(e.effects[s],this._rendererEffects,this),this.updateAllEffectParameters(e.effects[s]);this._timers.clear()}getElapsedTime(e){return this._runtimeScene.getLayer(this.layer).getElapsedTime()}getRuntimeScene(){return this._runtimeScene}update(e){}updatePreRender(e){}extraInitializationFromInitialInstance(e){}updateFromObjectData(e,t){return!1}deleteFromScene(e){this._livingOnScene&&(e.markObjectForDeletion(this),this._livingOnScene=!1)}onDestroyFromScene(e){const t=e.getLayer(this.layer),i=this.getRendererObject();i&&t.getRenderer().removeRendererObject(i);for(let s=0,a=this._behaviors.length;s<a;++s)this._behaviors[s].onDestroy();this.clearEffects()}onScenePaused(e){}onSceneResumed(e){}getRendererObject(){}getName(){return this.name}getNameId(){return this._nameId}getUniqueId(){return this.id}setPosition(e,t){this.setX(e),this.setY(t)}setX(e){e!==this.x&&(this.x=e,this.hitBoxesDirty=!0)}getX(){return this.x}setY(e){e!==this.y&&(this.y=e,this.hitBoxesDirty=!0)}getY(){return this.y}getDrawableX(){return this.getX()}getDrawableY(){return this.getY()}rotateTowardPosition(e,t,i,s){this.rotateTowardAngle(n.toDegrees(Math.atan2(t-(this.getDrawableY()+this.getCenterY()),e-(this.getDrawableX()+this.getCenterX()))),i,s)}rotateTowardAngle(e,t,i){if(t===0){this.setAngle(e);return}const a=n.evtTools.common.angleDifference(this.getAngle(),e)>=0;let r=this.getAngle()+(a?-1:1)*t*this.getElapsedTime(i)/1e3;n.evtTools.common.angleDifference(r,e)>0^a&&(r=e),this.setAngle(r),this.getAngle()!==r&&this.setAngle(e)}rotate(e,t){this.setAngle(this.getAngle()+e*this.getElapsedTime(t)/1e3)}setAngle(e){this.angle!==e&&(this.angle=e,this.hitBoxesDirty=!0)}getAngle(){return this.angle}setLayer(e){if(e===this.layer)return;const t=this._runtimeScene.getLayer(this.layer);this.layer=e;const i=this._runtimeScene.getLayer(this.layer),s=this.getRendererObject();s&&(t.getRenderer().removeRendererObject(s),i.getRenderer().addRendererObject(s,this.zOrder))}getLayer(){return this.layer}isOnLayer(e){return this.layer===e}setZOrder(e){if(e===this.zOrder)return;this.zOrder=e;const t=this.getRendererObject();t&&this._runtimeScene.getLayer(this.layer).getRenderer().changeRendererObjectZOrder(t,e)}getZOrder(){return this.zOrder}getVariables(){return this._variables}static getVariableNumber(e){return e.getAsNumber()}static returnVariable(e){return e}static getVariableString(e){return e.getAsString()}static getVariableChildCount(e){return e.getChildrenCount()}static setVariableNumber(e,t){e.setNumber(t)}static setVariableString(e,t){e.setString(t)}static variableChildExists(e,t){return e.hasChild(t)}static variableRemoveChild(e,t){e.removeChild(t)}static variableClearChildren(e){e.clearChildren()}hasVariable(e){return this._variables.has(e)}getRendererEffects(){return this._rendererEffects}addEffect(e){const t=this.getRendererObject();return t?this._runtimeScene.getGame().getEffectsManager().addEffect(e,this._rendererEffects,t,this):!1}removeEffect(e){const t=this.getRendererObject();return t?this._runtimeScene.getGame().getEffectsManager().removeEffect(this._rendererEffects,t,e):!1}clearEffects(){const e=this.getRendererObject();return e?(this._rendererEffects={},this._runtimeScene.getGame().getEffectsManager().clearEffects(e)):!1}setEffectDoubleParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectDoubleParameter(this._rendererEffects,e,t,i)}setEffectStringParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectStringParameter(this._rendererEffects,e,t,i)}setEffectBooleanParameter(e,t,i){return this._runtimeScene.getGame().getEffectsManager().setEffectBooleanParameter(this._rendererEffects,e,t,i)}updateAllEffectParameters(e){return this._runtimeScene.getGame().getEffectsManager().updateAllEffectParameters(this._rendererEffects,e)}enableEffect(e,t){this._runtimeScene.getGame().getEffectsManager().enableEffect(this._rendererEffects,e,t)}isEffectEnabled(e){return this._runtimeScene.getGame().getEffectsManager().isEffectEnabled(this._rendererEffects,e)}hasEffect(e){return this._runtimeScene.getGame().getEffectsManager().hasEffect(this._rendererEffects,e)}hide(e){e===void 0&&(e=!0),this.hidden=e}isVisible(){return!this.hidden}isHidden(){return this.hidden}setWidth(e){}setHeight(e){}getWidth(){return 0}getHeight(){return 0}getCenterX(){return this.getWidth()/2}getCenterY(){return this.getHeight()/2}getCenterXInScene(){return this.getDrawableX()+this.getCenterX()}getCenterYInScene(){return this.getDrawableY()+this.getCenterY()}setCenterPositionInScene(e,t){this.setX(e+this.x-(this.getDrawableX()+this.getCenterX())),this.setY(t+this.y-(this.getDrawableY()+this.getCenterY()))}setCenterXInScene(e){this.setX(e+this.x-(this.getDrawableX()+this.getCenterX()))}setCenterYInScene(e){this.setY(e+this.y-(this.getDrawableY()+this.getCenterY()))}_getRecycledForce(e,t,i){if(o.forcesGarbage.length===0)return new n.Force(e,t,i);{const s=o.forcesGarbage.pop();return s.setX(e),s.setY(t),s.setMultiplier(i),s}}addForce(e,t,i){this._forces.push(this._getRecycledForce(e,t,i))}addPolarForce(e,t,i){const s=n.toRad(e),a=Math.cos(s)*t,r=Math.sin(s)*t;this._forces.push(this._getRecycledForce(a,r,i))}addForceTowardPosition(e,t,i,s){const a=Math.atan2(t-(this.getDrawableY()+this.getCenterY()),e-(this.getDrawableX()+this.getCenterX())),r=Math.cos(a)*i,h=Math.sin(a)*i;this._forces.push(this._getRecycledForce(r,h,s))}addForceTowardObject(e,t,i){e!=null&&this.addForceTowardPosition(e.getDrawableX()+e.getCenterX(),e.getDrawableY()+e.getCenterY(),t,i)}clearForces(){o.forcesGarbage.push.apply(o.forcesGarbage,this._forces),this._forces.length=0}hasNoForces(){return this._forces.length===0}updateForces(e){for(let t=0;t<this._forces.length;){const i=this._forces[t],s=i.getMultiplier();s===1?++t:s===0||i.getLength()<=.001?(o.forcesGarbage.push(i),this._forces.splice(t,1)):(i.setLength(i.getLength()-i.getLength()*(1-s)*e),++t)}}getAverageForce(){let e=0,t=0;for(let i=0,s=this._forces.length;i<s;++i)e+=this._forces[i].getX(),t+=this._forces[i].getY();return this._averageForce.setX(e),this._averageForce.setY(t),this._averageForce}averageForceAngleIs(e,t){let i=this.getAverageForce().getAngle();return i<0&&(i+=360),Math.abs(e-i)<t/2}getHitBoxes(){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.hitBoxes}getHitBoxesAround(e,t,i,s){return this.getHitBoxes()}updateHitBoxes(){this.hitBoxes=this._defaultHitBoxes;const e=this.getWidth(),t=this.getHeight(),i=this.getCenterX(),s=this.getCenterY();i===e/2&&s===t/2?(this.hitBoxes[0].vertices[0][0]=-i,this.hitBoxes[0].vertices[0][1]=-s,this.hitBoxes[0].vertices[1][0]=+i,this.hitBoxes[0].vertices[1][1]=-s,this.hitBoxes[0].vertices[2][0]=+i,this.hitBoxes[0].vertices[2][1]=+s,this.hitBoxes[0].vertices[3][0]=-i,this.hitBoxes[0].vertices[3][1]=+s):(this.hitBoxes[0].vertices[0][0]=0-i,this.hitBoxes[0].vertices[0][1]=0-s,this.hitBoxes[0].vertices[1][0]=e-i,this.hitBoxes[0].vertices[1][1]=0-s,this.hitBoxes[0].vertices[2][0]=e-i,this.hitBoxes[0].vertices[2][1]=t-s,this.hitBoxes[0].vertices[3][0]=0-i,this.hitBoxes[0].vertices[3][1]=t-s),this.hitBoxes[0].rotate(n.toRad(this.getAngle())),this.hitBoxes[0].move(this.getDrawableX()+i,this.getDrawableY()+s)}getAABB(){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.aabb}getVisibilityAABB(){return this.getAABB()}updateAABB(){if(this.getAngle()===0)this.aabb.min[0]=this.getDrawableX(),this.aabb.min[1]=this.getDrawableY(),this.aabb.max[0]=this.aabb.min[0]+this.getWidth(),this.aabb.max[1]=this.aabb.min[1]+this.getHeight();else{let e=!0;for(let t=0;t<this.hitBoxes.length;t++)for(let i=0;i<this.hitBoxes[t].vertices.length;i++){const s=this.hitBoxes[t].vertices[i];e?(this.aabb.min[0]=s[0],this.aabb.max[0]=s[0],this.aabb.min[1]=s[1],this.aabb.max[1]=s[1],e=!1):(this.aabb.min[0]=Math.min(this.aabb.min[0],s[0]),this.aabb.max[0]=Math.max(this.aabb.max[0],s[0]),this.aabb.min[1]=Math.min(this.aabb.min[1],s[1]),this.aabb.max[1]=Math.max(this.aabb.max[1],s[1]))}}}getAABBLeft(){return this.getAABB().min[0]}getAABBTop(){return this.getAABB().min[1]}getAABBRight(){return this.getAABB().max[0]}getAABBBottom(){return this.getAABB().max[1]}getAABBCenterX(){return this.getAABB().min[0]/2+this.getAABB().max[0]/2}getAABBCenterY(){return this.getAABB().min[1]/2+this.getAABB().max[1]/2}stepBehaviorsPreEvents(e){for(let t=0,i=this._behaviors.length;t<i;++t)this._behaviors[t].stepPreEvents(e)}stepBehaviorsPostEvents(e){for(let t=0,i=this._behaviors.length;t<i;++t)this._behaviors[t].stepPostEvents(e)}notifyBehaviorsObjectHotReloaded(){for(let e=0,t=this._behaviors.length;e<t;++e)this._behaviors[e].onObjectHotReloaded()}getBehavior(e){return this._behaviorsTable.get(e)}hasBehavior(e){return this._behaviorsTable.containsKey(e)}activateBehavior(e,t){this._behaviorsTable.containsKey(e)&&this._behaviorsTable.get(e).activate(t)}behaviorActivated(e){return this._behaviorsTable.containsKey(e)?this._behaviorsTable.get(e).activated():!1}removeBehavior(e){const t=this._behaviorsTable.get(e);if(!t)return!1;t.onDestroy();const i=this._behaviors.indexOf(t);return i!==-1&&this._behaviors.splice(i,1),this._behaviorsTable.remove(e),!0}addNewBehavior(e){const t=n.getBehaviorConstructor(e.type);if(!t)return!1;const i=new t(this._runtimeScene,e,this);return this._behaviors.push(i),this._behaviorsTable.put(e.name,i),!0}updateTimers(e){for(const t in this._timers.items)this._timers.items.hasOwnProperty(t)&&this._timers.items[t].updateTime(e)}timerElapsedTime(e,t){return this._timers.containsKey(e)?this.getTimerElapsedTimeInSeconds(e)>=t:(this._timers.put(e,new n.Timer(e)),!1)}timerPaused(e){return this._timers.containsKey(e)?this._timers.get(e).isPaused():!1}resetTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).reset()}pauseTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).setPaused(!0)}unpauseTimer(e){this._timers.containsKey(e)||this._timers.put(e,new n.Timer(e)),this._timers.get(e).setPaused(!1)}removeTimer(e){this._timers.containsKey(e)&&this._timers.remove(e)}getTimerElapsedTimeInSeconds(e){return this._timers.containsKey(e)?this._timers.get(e).getTime()/1e3:0}getTimerElapsedTimeInSecondsOrNaN(e){return this._timers.containsKey(e)?this._timers.get(e).getTime()/1e3:Number.NaN}separateFromObjects(e,t){let i=_.moveXArray,s=_.moveYArray;i.length=0,s.length=0;const a=this.getHitBoxes();let r=null;for(const h of e){if(h.id===this.id)continue;let u=h.getHitBoxes(),g=u;u.length>4&&(r||(r=this.getAABB()),g=h.getHitBoxesAround(r.min[0],r.min[1],r.max[0],r.max[1]));for(const c of a)for(const l of g){const f=n.Polygon.collisionTest(c,l,t);f.collision&&(i.push(f.move_axis[0]),s.push(f.move_axis[1]))}}return C(this,i,s)}separateFromObjectsList(e,t){let i=_.moveXArray,s=_.moveYArray;i.length=0,s.length=0;const a=this.getHitBoxes();let r=null;for(const h in e.items)if(e.items.hasOwnProperty(h)){const u=e.items[h];for(const g of u){if(g.id===this.id)continue;let c=g.getHitBoxes(),l=c;c.length>4&&(r||(r=this.getAABB()),l=g.getHitBoxesAround(r.min[0],r.min[1],r.max[0],r.max[1]));for(const f of a)for(const v of l){const b=n.Polygon.collisionTest(f,v,t);b.collision&&(i.push(b.move_axis[0]),s.push(b.move_axis[1]))}}}return C(this,i,s)}getDistanceToObject(e){return Math.sqrt(this.getSqDistanceToObject(e))}getSqDistanceToObject(e){if(e===null)return 0;const t=this.getDrawableX()+this.getCenterX()-(e.getDrawableX()+e.getCenterX()),i=this.getDrawableY()+this.getCenterY()-(e.getDrawableY()+e.getCenterY());return t*t+i*i}getDistanceToPosition(e,t){return Math.sqrt(this.getSqDistanceToPosition(e,t))}getSqDistanceToPosition(e,t){const i=this.getDrawableX()+this.getCenterX()-e,s=this.getDrawableY()+this.getCenterY()-t;return i*i+s*s}getAngleToObject(e){if(e===null)return 0;const t=this.getDrawableX()+this.getCenterX()-(e.getDrawableX()+e.getCenterX()),i=this.getDrawableY()+this.getCenterY()-(e.getDrawableY()+e.getCenterY());return n.toDegrees(Math.atan2(-i,-t))}getXFromAngleAndDistance(e,t){return this.getDrawableX()+this.getCenterX()+t*Math.cos(n.toRad(e))}getYFromAngleAndDistance(e,t){return this.getDrawableY()+this.getCenterY()+t*Math.sin(n.toRad(e))}getAngleToPosition(e,t){const i=this.getDrawableX()+this.getCenterX()-e,s=this.getDrawableY()+this.getCenterY()-t;return n.toDegrees(Math.atan2(-s,-i))}putAround(e,t,i,s){const a=n.toRad(s);this.setCenterXInScene(e+Math.cos(a)*i),this.setCenterYInScene(t+Math.sin(a)*i)}putAroundObject(e,t,i){this.putAround(e.getDrawableX()+e.getCenterX(),e.getDrawableY()+e.getCenterY(),t,i)}separateObjectsWithoutForces(e){const t=n.staticArray(o.prototype.separateObjectsWithoutForces);t.length=0;const i=n.staticArray2(o.prototype.separateObjectsWithoutForces);e.values(i);for(let s=0,a=i.length;s<a;++s)t.push.apply(t,i[s]);for(let s=0,a=t.length;s<a;++s)t[s].id!=this.id&&(this.getDrawableX()<t[s].getDrawableX()?this.setX(t[s].getDrawableX()-this.getWidth()):this.getDrawableX()+this.getWidth()>t[s].getDrawableX()+t[s].getWidth()&&this.setX(t[s].getDrawableX()+t[s].getWidth()),this.getDrawableY()<t[s].getDrawableY()?this.setY(t[s].getDrawableY()-this.getHeight()):this.getDrawableY()+this.getHeight()>t[s].getDrawableY()+t[s].getHeight()&&this.setY(t[s].getDrawableY()+t[s].getHeight()))}separateObjectsWithForces(e){const t=n.staticArray(o.prototype.separateObjectsWithForces);t.length=0;const i=n.staticArray2(o.prototype.separateObjectsWithForces);e.values(i);for(let s=0,a=i.length;s<a;++s)t.push.apply(t,i[s]);for(let s=0,a=t.length;s<a;++s)if(t[s].id!=this.id){if(this.getDrawableX()+this.getCenterX()<t[s].getDrawableX()+t[s].getCenterX()){let r=this.hasNoForces()?0:this.getAverageForce().getX();this.addForce(-r-10,0,0)}else{let r=this.hasNoForces()?0:this.getAverageForce().getX();this.addForce(-r+10,0,0)}if(this.getDrawableY()+this.getCenterY()<t[s].getDrawableY()+t[s].getCenterY()){let r=this.hasNoForces()?0:this.getAverageForce().getY();this.addForce(0,-r-10,0)}else{let r=this.hasNoForces()?0:this.getAverageForce().getY();this.addForce(0,-r+10,0)}}}static collisionTest(e,t,i){const s=e.getCenterX(),a=e.getCenterY(),r=Math.sqrt(D(e.getWidth(),e.getHeight(),s,a)),h=t.getCenterX(),u=t.getCenterY(),g=Math.sqrt(D(t.getWidth(),t.getHeight(),h,u)),c=e.getDrawableX()+s,l=e.getDrawableY()+a,f=t.getDrawableX()+h,v=t.getDrawableY()+u,b=c-f,p=l-v;if(Math.sqrt(b*b+p*p)>r+g)return!1;const m=e.getHitBoxesAround(f-g,v-g,f+g,v+g),A=t.getHitBoxesAround(c-r,l-r,c+r,l+r);for(const d of m)for(const y of A)if(n.Polygon.collisionTest(d,y,i).collision)return!0;return!1}raycastTest(e,t,i,s,a){const r=this.getCenterX(),h=this.getCenterY(),u=D(this.getWidth(),this.getHeight(),r,h),g=(e+i)/2,c=(t+s)/2,l=(i-e)*(i-e)+(s-t)*(s-t),f=this.getDrawableX()+r-g,v=this.getDrawableY()+h-c;let b=n.Polygon.raycastTestStatics.result;if(b.collision=!1,f*f+v*v>u+l+2*Math.sqrt(l*u))return b;let p=a?l:0;const m=this.getHitBoxesAround(e,t,i,s);for(const A of m){const d=n.Polygon.raycastTest(A,e,t,i,s);d.collision&&(a&&d.closeSqDist<p?(p=d.closeSqDist,b=d):!a&&d.farSqDist>p&&d.farSqDist<=l&&(p=d.farSqDist,b=d))}return b}insideObject(e,t){return this.hitBoxesDirty&&(this.updateHitBoxes(),this.updateAABB(),this.hitBoxesDirty=!1),this.aabb.min[0]<=e&&this.aabb.max[0]>=e&&this.aabb.min[1]<=t&&this.aabb.max[1]>=t}static distanceTest(e,t,i){return e.getSqDistanceToObject(t)<=i}cursorOnObject(e){const t=e.getGame().getInputManager(),i=e.getLayer(this.layer),s=i.convertCoords(t.getMouseX(),t.getMouseY());if(this.insideObject(s[0],s[1]))return!0;const a=t.getAllTouchIdentifiers();for(let r=0;r<a.length;++r){const h=i.convertCoords(t.getTouchX(a[r]),t.getTouchY(a[r]));if(this.insideObject(h[0],h[1]))return!0}return!1}isCollidingWithPoint(e,t){const i=this.getHitBoxesAround(e,t,e,t);for(const s of i)if(n.Polygon.isPointInside(s,e,t))return!0;return!1}static getNameIdentifier(e){if(o._identifiers.containsKey(e))return o._identifiers.get(e);o._newId=(o._newId||0)+1;const t=o._newId;return o._identifiers.put(e,t),t}};let B=o;B.supportsReinitialization=!1,B.setVariableBoolean=function(e,t){e.setBoolean(t)},B.getVariableBoolean=function(e,t){return n.evtTools.common.getVariableBoolean(e,t)},B.toggleVariableBoolean=function(e){n.evtTools.common.toggleVariableBoolean(e)},B.variablePushCopy=function(e,t){e.pushVariableCopy(t)},B.valuePush=function(e,t){e.pushValue(t)},B.variableRemoveAt=function(e,t){e.removeAtIndex(t)},B._identifiers=new Hashtable,B._newId=0,B.forcesGarbage=[],n.RuntimeObject=B,n.registerObject("",n.RuntimeObject)})(gdjs||(gdjs={}));
//# sourceMappingURL=runtimeobject.js.map