TMT-Demo/assets/gameLoop.c6fcb607.js

1 line
2.4 KiB
JavaScript

import{_ as d,s as p,p as e,a as o,l as T,D as l,b as m,g as u}from"./index.224b6502.js";import"./vue.72cfed44.js";import{b4 as c}from"./@vue.6a1d7e86.js";/* empty css */import"./lz-string.dccec454.js";import"./@ivanv.c33db252.js";import"./nanoevents.1080beb7.js";import"./vue-next-select.3d5e8343.js";import"./vuedraggable.a52097e2.js";import"./earcut.b6f90e68.js";import"./sortablejs.740e9352.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-toastification.42f47de1.js";import"./@pixi.94823b24.js";import"./ismobilejs.5c6954b9.js";import"./eventemitter3.dc5195d7.js";import"./url.68c785f7.js";import"./querystring.d4befb87.js";let n=null,f=null;function a(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(o.lastTenTicks.push(r),o.lastTenTicks.length>10&&(o.lastTenTicks=o.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!o.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(l.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),l.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||l.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!l.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),u.emit("update",i,r),p.unthrottled?(requestAnimationFrame(a),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(a,50)))}}async function M(){f=(await d(()=>import("./index.224b6502.js").then(function(t){return t.c}),["assets/index.224b6502.js","assets/index.237818d0.css","assets/@fontsource.f66d05e7.css","assets/vue.72cfed44.js","assets/earcut.b6f90e68.js","assets/@vue.6a1d7e86.js","assets/lz-string.dccec454.js","assets/@ivanv.c33db252.js","assets/nanoevents.1080beb7.js","assets/vue-next-select.3d5e8343.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.a52097e2.js","assets/sortablejs.740e9352.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-toastification.42f47de1.js","assets/vue-toastification.4b5f8ac8.css","assets/@pixi.94823b24.js","assets/ismobilejs.5c6954b9.js","assets/eventemitter3.dc5195d7.js","assets/url.68c785f7.js","assets/querystring.d4befb87.js"])).hasWon,c(f,t=>{t&&u.emit("gameWon")}),p.unthrottled?requestAnimationFrame(a):n=setInterval(a,50)}export{M as startGameLoop};