var gdjs;(function(r){let c;(function(g){let u;(function(s){s.sceneJustBegins=function(t){return t.getScene().getTimeManager().isFirstFrame()},s.sceneJustResumed=function(t){return t.getScene().sceneJustResumed()},s.getSceneName=function(t){return t.getScene().getName()},s.setBackgroundColor=function(t,e){const n=r.rgbOrHexToRGBColor(e);t.getScene().setBackgroundColor(n[0],n[1],n[2])},s.getElapsedTimeInSeconds=function(t){return t.getScene().getTimeManager().getElapsedTime()/1e3},s.setTimeScale=function(t,e){return t.getScene().getTimeManager().setTimeScale(e)},s.getTimeScale=function(t){return t.getScene().getTimeManager().getTimeScale()},s.timerElapsedTime=function(t,e,n){const a=t.getScene().getTimeManager();return a.hasTimer(n)?a.getTimer(n).getTime()/1e3>=e:(a.addTimer(n),!1)},s.timerPaused=function(t,e){const n=t.getScene().getTimeManager();return n.hasTimer(e)?n.getTimer(e).isPaused():!1},s.resetTimer=function(t,e){const n=t.getScene().getTimeManager();n.hasTimer(e)?n.getTimer(e).reset():n.addTimer(e)},s.pauseTimer=function(t,e){const n=t.getScene().getTimeManager();n.hasTimer(e)||n.addTimer(e),n.getTimer(e).setPaused(!0)},s.unpauseTimer=function(t,e){const n=t.getScene().getTimeManager();return n.hasTimer(e)||n.addTimer(e),n.getTimer(e).setPaused(!1)},s.removeTimer=function(t,e){t.getScene().getTimeManager().removeTimer(e)};class d extends r.AsyncTask{constructor(e){super();this.timeElapsedOnScene=0;this.duration=e}update(e){return this.timeElapsedOnScene+=e.getScene().getTimeManager().getElapsedTime(),this.timeElapsedOnScene>=this.duration}getNetworkSyncData(){return{type:"wait",duration:this.duration,timeElapsedOnScene:this.timeElapsedOnScene}}updateFromNetworkSyncData(e){this.duration=e.duration,this.timeElapsedOnScene=e.timeElapsedOnScene}}s.WaitTask=d,s.wait=t=>new d(t*1e3),s.getTimerElapsedTimeInSeconds=function(t,e){const n=t.getScene().getTimeManager();return n.hasTimer(e)?n.getTimer(e).getTime()/1e3:0},s.getTimerElapsedTimeInSecondsOrNaN=function(t,e){const n=t.getScene().getTimeManager();return n.hasTimer(e)?n.getTimer(e).getTime()/1e3:Number.NaN},s.getTimeFromStartInSeconds=function(t){return t.getScene().getTimeManager().getTimeFromStart()/1e3},s.getTime=function(t,e){if(e==="timestamp")return Date.now();const n=new Date;if(e==="hour")return n.getHours();if(e==="min")return n.getMinutes();if(e==="sec")return n.getSeconds();if(e==="mday")return n.getDate();if(e==="mon")return n.getMonth();if(e==="year")return n.getFullYear()-1900;if(e==="wday")return n.getDay();if(e==="yday"){const a=new Date(n.getFullYear(),0,0),i=n.getTime()-a.getTime(),o=1e3*60*60*24;return Math.floor(i/o)}return 0},s.replaceScene=function(t,e,n){!t.getGame().getSceneAndExtensionsData(e)||t.getScene().requestChange(n?r.SceneChangeRequest.CLEAR_SCENES:r.SceneChangeRequest.REPLACE_SCENE,e)},s.pushScene=function(t,e){!t.getGame().getSceneAndExtensionsData(e)||t.getScene().requestChange(r.SceneChangeRequest.PUSH_SCENE,e)},s.popScene=function(t){t.getScene().requestChange(r.SceneChangeRequest.POP_SCENE)},s.stopGame=function(t){t.getScene().requestChange(r.SceneChangeRequest.STOP_GAME)},s.createObjectsFromExternalLayout=function(t,e,n,a,i){const o=t.getGame().getExternalLayoutData(e);o!==null&&t.getScene().createObjectsFrom(o.instances,n,a,i||0,!1)},s.hasGameJustResumed=t=>t.getGame().hasJustResumed(),s.doesSceneExist=(t,e)=>t.getGame().hasScene(e),s.prioritizeLoadingOfScene=(t,e)=>{t.getGame().prioritizeLoadingOfScene(e)},s.getSceneLoadingProgress=(t,e)=>t.getGame().getSceneLoadingProgress(e),s.areSceneAssetsLoaded=(t,e)=>t.getGame().areSceneAssetsLoaded(e)})(u=g.runtimeScene||(g.runtimeScene={}))})(c=r.evtTools||(r.evtTools={}))})(gdjs||(gdjs={}));
//# sourceMappingURL=runtimescenetools.js.map
