diff --git a/battle_srv/models/player.go b/battle_srv/models/player.go index c4bcd03..f4f92e2 100644 --- a/battle_srv/models/player.go +++ b/battle_srv/models/player.go @@ -47,11 +47,10 @@ type Player struct { TutorialStage int `db:"tutorial_stage"` // other in-battle info fields - LastReceivedInputFrameId int32 - LastUdpReceivedInputFrameId int32 - LastSentInputFrameId int32 - AckingFrameId int32 - AckingInputFrameId int32 + LastConsecutiveRecvInputFrameId int32 + LastSentInputFrameId int32 + AckingFrameId int32 + AckingInputFrameId int32 UdpAddr *PeerUdpAddr BattleUdpTunnelAddr *net.UDPAddr // This addr is used by backend only, not visible to frontend diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index 56711cc..b21085e 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -136,7 +136,7 @@ type Room struct { EffectivePlayerCount int32 DismissalWaitGroup sync.WaitGroup InputsBuffer *resolv.RingBuffer // Indices are STRICTLY consecutive - InputsBufferLock sync.Mutex // Guards [InputsBuffer, LatestPlayerUpsyncedInputFrameId, LastAllConfirmedInputFrameId, LastAllConfirmedInputList, LastAllConfirmedInputFrameIdWithChange, LastIndividuallyConfirmedInputList, player.LastReceivedInputFrameId, player.LastUdpReceivedInputFrameId] + InputsBufferLock sync.Mutex // Guards [InputsBuffer, LatestPlayerUpsyncedInputFrameId, LastAllConfirmedInputFrameId, LastAllConfirmedInputList, LastAllConfirmedInputFrameIdWithChange, LastIndividuallyConfirmedInputFrameId, LastIndividuallyConfirmedInputList, player.LastConsecutiveRecvInputFrameId] RenderFrameBuffer *resolv.RingBuffer // Indices are STRICTLY consecutive LatestPlayerUpsyncedInputFrameId int32 LastAllConfirmedInputFrameId int32 @@ -156,8 +156,9 @@ type Room struct { TmxPointsMap StrToVec2DListMap TmxPolygonsMap StrToPolygon2DListMap - rdfIdToActuallyUsedInput map[int32]*pb.InputFrameDownsync - LastIndividuallyConfirmedInputList []uint64 + rdfIdToActuallyUsedInput map[int32]*pb.InputFrameDownsync + LastIndividuallyConfirmedInputFrameId []int32 + LastIndividuallyConfirmedInputList []uint64 BattleUdpTunnelLock sync.Mutex BattleUdpTunnelAddr *pb.PeerUdpAddr @@ -194,8 +195,7 @@ func (pR *Room) AddPlayerIfPossible(pPlayerFromDbInit *Player, speciesId int, se pPlayerFromDbInit.AckingFrameId = -1 pPlayerFromDbInit.AckingInputFrameId = -1 pPlayerFromDbInit.LastSentInputFrameId = MAGIC_LAST_SENT_INPUT_FRAME_ID_NORMAL_ADDED - pPlayerFromDbInit.LastReceivedInputFrameId = MAGIC_LAST_SENT_INPUT_FRAME_ID_NORMAL_ADDED - pPlayerFromDbInit.LastUdpReceivedInputFrameId = MAGIC_LAST_SENT_INPUT_FRAME_ID_NORMAL_ADDED + pPlayerFromDbInit.LastConsecutiveRecvInputFrameId = MAGIC_LAST_SENT_INPUT_FRAME_ID_NORMAL_ADDED pPlayerFromDbInit.BattleState = PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK pPlayerFromDbInit.ColliderRadius = DEFAULT_PLAYER_RADIUS // Hardcoded @@ -237,7 +237,7 @@ func (pR *Room) ReAddPlayerIfPossible(pTmpPlayerInstance *Player, session *webso pEffectiveInRoomPlayerInstance.AckingFrameId = -1 pEffectiveInRoomPlayerInstance.AckingInputFrameId = -1 pEffectiveInRoomPlayerInstance.LastSentInputFrameId = MAGIC_LAST_SENT_INPUT_FRAME_ID_READDED - // [WARNING] DON'T reset "player.LastReceivedInputFrameId" & "player.LastUdpReceivedInputFrameId" upon reconnection! + // [WARNING] DON'T reset "player.LastConsecutiveRecvInputFrameId" & "pR.LastIndividuallyConfirmedInputFrameId[...]" upon reconnection! pEffectiveInRoomPlayerInstance.BattleState = PlayerBattleStateIns.READDED_PENDING_BATTLE_COLLIDER_ACK pEffectiveInRoomPlayerInstance.ColliderRadius = DEFAULT_PLAYER_RADIUS // Hardcoded @@ -804,6 +804,10 @@ func (pR *Room) OnDismissed() { pR.RenderFrameBuffer = resolv.NewRingBuffer(pR.RenderCacheSize) pR.InputsBuffer = resolv.NewRingBuffer((pR.RenderCacheSize >> 1) + 1) pR.rdfIdToActuallyUsedInput = make(map[int32]*pb.InputFrameDownsync) + pR.LastIndividuallyConfirmedInputFrameId = make([]int32, pR.Capacity) + for i := 0; i < pR.Capacity; i++ { + pR.LastIndividuallyConfirmedInputFrameId[i] = MAGIC_LAST_SENT_INPUT_FRAME_ID_NORMAL_ADDED + } pR.LastIndividuallyConfirmedInputList = make([]uint64, pR.Capacity) pR.LatestPlayerUpsyncedInputFrameId = -1 @@ -817,7 +821,7 @@ func (pR *Room) OnDismissed() { pR.collisionHolder = resolv.NewCollision() pR.effPushbacks = make([]*battle.Vec2D, pR.Capacity) - for i := 0; i < len(pR.effPushbacks); i++ { + for i := 0; i < pR.Capacity; i++ { pR.effPushbacks[i] = &battle.Vec2D{X: 0, Y: 0} } pR.hardPushbackNormsArr = make([][]*battle.Vec2D, pR.Capacity) @@ -1190,9 +1194,9 @@ func (pR *Room) markConfirmationIfApplicable(inputFrameUpsyncBatch []*pb.InputFr Logger.Debug(fmt.Sprintf("Omitting obsolete inputFrameUpsync#1: roomId=%v, playerId=%v, clientInputFrameId=%v, InputsBuffer=%v", pR.Id, playerId, clientInputFrameId, pR.InputsBufferString(false))) continue } - if clientInputFrameId < player.LastReceivedInputFrameId { - // [WARNING] It's important for correctness that we use "player.LastReceivedInputFrameId" instead of "player.LastUdpReceivedInputFrameId" here! - Logger.Debug(fmt.Sprintf("Omitting obsolete inputFrameUpsync#2: roomId=%v, playerId=%v, clientInputFrameId=%v, playerLastReceivedInputFrameId=%v, InputsBuffer=%v", pR.Id, playerId, clientInputFrameId, player.LastReceivedInputFrameId, pR.InputsBufferString(false))) + if clientInputFrameId < player.LastConsecutiveRecvInputFrameId { + // [WARNING] It's important for correctness that we use "player.LastConsecutiveRecvInputFrameId" instead of "pR.LastIndividuallyConfirmedInputFrameId[player.JoinIndex-1]" here! + Logger.Debug(fmt.Sprintf("Omitting obsolete inputFrameUpsync#2: roomId=%v, playerId=%v, clientInputFrameId=%v, playerLastConsecutiveRecvInputFrameId=%v, InputsBuffer=%v", pR.Id, playerId, clientInputFrameId, player.LastConsecutiveRecvInputFrameId, pR.InputsBufferString(false))) continue } if clientInputFrameId > pR.InputsBuffer.EdFrameId { @@ -1208,19 +1212,19 @@ func (pR *Room) markConfirmationIfApplicable(inputFrameUpsyncBatch []*pb.InputFr /* [WARNING] We have to distinguish whether or not the incoming batch is from UDP here, otherwise "pR.LatestPlayerUpsyncedInputFrameId - pR.LastAllConfirmedInputFrameId" might become unexpectedly large in case of "UDP packet loss + slow ws session"! - Moreover, only ws session upsyncs should advance "player.LastReceivedInputFrameId" & "pR.LatestPlayerUpsyncedInputFrameId". + Moreover, only ws session upsyncs should advance "player.LastConsecutiveRecvInputFrameId" & "pR.LatestPlayerUpsyncedInputFrameId". - Kindly note that the updates of "player.LastReceivedInputFrameId" could be discrete before and after reconnection. + Kindly note that the updates of "player.LastConsecutiveRecvInputFrameId" could be discrete before and after reconnection. */ - player.LastReceivedInputFrameId = clientInputFrameId + player.LastConsecutiveRecvInputFrameId = clientInputFrameId if clientInputFrameId > pR.LatestPlayerUpsyncedInputFrameId { pR.LatestPlayerUpsyncedInputFrameId = clientInputFrameId } } - if clientInputFrameId > player.LastUdpReceivedInputFrameId { - // No need to update "player.LastUdpReceivedInputFrameId" only when "true == fromUDP", we should keep "player.LastUdpReceivedInputFrameId >= player.LastReceivedInputFrameId" at any moment. - player.LastUdpReceivedInputFrameId = clientInputFrameId + if clientInputFrameId > pR.LastIndividuallyConfirmedInputFrameId[player.JoinIndex-1] { + // No need to update "pR.LastIndividuallyConfirmedInputFrameId[player.JoinIndex-1]" only when "true == fromUDP", we should keep "pR.LastIndividuallyConfirmedInputFrameId[player.JoinIndex-1] >= player.LastConsecutiveRecvInputFrameId" at any moment. + pR.LastIndividuallyConfirmedInputFrameId[player.JoinIndex-1] = clientInputFrameId // It's safe (in terms of getting an eventually correct "RenderFrameBuffer") to put the following update of "pR.LastIndividuallyConfirmedInputList" which is ONLY used for prediction in "InputsBuffer" out of "false == fromUDP" block. pR.LastIndividuallyConfirmedInputList[player.JoinIndex-1] = inputFrameUpsync.Encoded } @@ -1379,7 +1383,7 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende } } - battle.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(pR.InputsBuffer, currRenderFrame.Id, pR.Space, pR.CollisionSysMap, pR.SpaceOffsetX, pR.SpaceOffsetY, pR.CharacterConfigsArr, pR.RenderFrameBuffer, pR.collisionHolder, pR.effPushbacks, pR.hardPushbackNormsArr, pR.jumpedOrNotList, pR.dynamicRectangleColliders) + battle.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(pR.InputsBuffer, currRenderFrame.Id, pR.Space, pR.CollisionSysMap, pR.SpaceOffsetX, pR.SpaceOffsetY, pR.CharacterConfigsArr, pR.RenderFrameBuffer, pR.collisionHolder, pR.effPushbacks, pR.hardPushbackNormsArr, pR.jumpedOrNotList, pR.dynamicRectangleColliders, pR.LastIndividuallyConfirmedInputFrameId, pR.LastIndividuallyConfirmedInputList) pR.CurDynamicsRenderFrameId++ } } diff --git a/frontend/assets/scripts/Map.js b/frontend/assets/scripts/Map.js index fb6663c..82ca03c 100644 --- a/frontend/assets/scripts/Map.js +++ b/frontend/assets/scripts/Map.js @@ -512,8 +512,7 @@ cc.Class({ window.clearBoundRoomIdInBothVolatileAndPersistentStorage(); window.initPersistentSessionClient(self.initAfterWSConnected, null /* Deliberately NOT passing in any `expectedRoomId`. -- YFLu */ ); }; - resultPanelScriptIns.onCloseDelegate = () => { - }; + resultPanelScriptIns.onCloseDelegate = () => {}; self.gameRuleNode = cc.instantiate(self.gameRulePrefab); self.gameRuleNode.width = self.canvasNode.width; @@ -1428,7 +1427,7 @@ othersForcedDownsyncRenderFrame=${JSON.stringify(othersForcedDownsyncRenderFrame }; self.rdfIdToActuallyUsedInput.set(i, inputFrameDownsyncClone); } - const renderRes = gopkgs.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(self.recentInputCache, i, collisionSys, collisionSysMap, self.spaceOffsetX, self.spaceOffsetY, self.chConfigsOrderedByJoinIndex, self.recentRenderCache, self.collisionHolder, self.effPushbacks, self.hardPushbackNormsArr, self.jumpedOrNotList, self.dynamicRectangleColliders); + const renderRes = gopkgs.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(self.recentInputCache, i, collisionSys, collisionSysMap, self.spaceOffsetX, self.spaceOffsetY, self.chConfigsOrderedByJoinIndex, self.recentRenderCache, self.collisionHolder, self.effPushbacks, self.hardPushbackNormsArr, self.jumpedOrNotList, self.dynamicRectangleColliders, self.lastIndividuallyConfirmedInputFrameId, self.lastIndividuallyConfirmedInputList); const nextRdf = gopkgs.GetRoomDownsyncFrame(self.recentRenderCache, i + 1); if (true == isChasing) { diff --git a/frontend/assets/scripts/modules/jsexport.js b/frontend/assets/scripts/modules/jsexport.js index daf7e7d..a663989 100644 --- a/frontend/assets/scripts/modules/jsexport.js +++ b/frontend/assets/scripts/modules/jsexport.js @@ -9,8 +9,8 @@ $packages["runtime"]=(function(){var $pkg={},$init,A,C,D,AT,AZ,BD,AM,E,AU;A=$pac $packages["math/bits"]=(function(){var $pkg={},$init;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["math"]=(function(){var $pkg={},$init,B,A,IT,IU,IV,IW,FL,FM,FN,FO,FP,HH,EI,EX,EY,FK,GA,GH,GK,GL,GM,GS,GT,GW,GX,GZ,HA,HD,HI,HL,HM;B=$packages["github.com/gopherjs/gopherjs/js"];A=$packages["math/bits"];IT=$arrayType($Uint32,2);IU=$arrayType($Float32,2);IV=$arrayType($Float64,1);IW=$structType("math",[{prop:"uint32array",name:"uint32array",embedded:false,exported:false,typ:IT,tag:""},{prop:"float32array",name:"float32array",embedded:false,exported:false,typ:IU,tag:""},{prop:"float64array",name:"float64array",embedded:false,exported:false,typ:IV,tag:""}]);EI=function(av){var av,aw,ax,ay,az,ba,bb;aw=HL(av);ax=((($shiftRightUint64(aw,52).$low>>>0))&2047)>>>0;if(ax<1023){aw=(ay=new $Uint64(2147483648,0),new $Uint64(aw.$high&ay.$high,(aw.$low&ay.$low)>>>0));if(ax===1022){aw=(az=new $Uint64(1072693248,0),new $Uint64(aw.$high|az.$high,(aw.$low|az.$low)>>>0));}}else if(ax<1075){ax=ax-(1023)>>>0;aw=(ba=$shiftRightUint64(new $Uint64(524288,0),ax),new $Uint64(aw.$high+ba.$high,aw.$low+ba.$low));aw=(bb=$shiftRightUint64(new $Uint64(1048575,4294967295),ax),new $Uint64(aw.$high&~bb.$high,(aw.$low&~bb.$low)>>>0));}return HM(aw);};$pkg.Round=EI;EX=function(av,aw){var av,aw;if(GL(av,1)||GL(aw,1)){return GK(1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return aw;}return av;}if(av>aw){return av;}return aw;};EY=function(av,aw){var av,aw;if(GL(av,-1)||GL(aw,-1)){return GK(-1);}else if(GM(av)||GM(aw)){return GW();}else if((av===0)&&(av===aw)){if(GZ(av)){return av;}return aw;}if(av>>0)));};$pkg.Abs=FK;GA=function(av){var av;return $parseFloat(FL.cos(av));};$pkg.Cos=GA;GH=function(av){var av;return $parseFloat(FL.floor(av));};$pkg.Floor=GH;GK=function(av){var av;if(av>=0){return FN;}else{return FO;}};$pkg.Inf=GK;GL=function(av,aw){var av,aw;if(av===FN){return aw>=0;}if(av===FO){return aw<=0;}return false;};$pkg.IsInf=GL;GM=function(av){var av,aw;aw=false;aw=!((av===av));return aw;};$pkg.IsNaN=GM;GS=function(av,aw){var av,aw;return EX(av,aw);};$pkg.Max=GS;GT=function(av,aw){var av,aw;return EY(av,aw);};$pkg.Min=GT;GW=function(){return FP;};$pkg.NaN=GW;GX=function(av,aw){var av,aw;if((av===1)||((av===-1)&&((aw===FN)||(aw===FO)))){return 1;}return $parseFloat(FL.pow(av,aw));};$pkg.Pow=GX;GZ=function(av){var av;return av<0||(1/av===FO);};$pkg.Signbit=GZ;HA=function(av){var av;return $parseFloat(FL.sin(av));};$pkg.Sin=HA;HD=function(av){var av;return $parseFloat(FL.sqrt(av));};$pkg.Sqrt=HD;HI=function(){var av;av=new($global.ArrayBuffer)(8);HH.uint32array=new($global.Uint32Array)(av);HH.float32array=new($global.Float32Array)(av);HH.float64array=new($global.Float64Array)(av);};HL=function(av){var av,aw,ax;HH.float64array[0]=av;return(aw=$shiftLeft64((new $Uint64(0,HH.uint32array[1])),32),ax=(new $Uint64(0,HH.uint32array[0])),new $Uint64(aw.$high+ax.$high,aw.$low+ax.$low));};$pkg.Float64bits=HL;HM=function(av){var av;HH.uint32array[0]=((av.$low>>>0));HH.uint32array[1]=(($shiftRightUint64(av,32).$low>>>0));return HH.float64array[0];};$pkg.Float64frombits=HM;$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=B.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=A.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}HH=new IW.ptr(IT.zero(),IU.zero(),IV.zero());FL=$global.Math;FM=0;FN=1/FM;FO=-1/FM;FP=$parseFloat($NaN);HI();}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["resolv"]=(function(){var $pkg={},$init,A,B,C,N,P,Q,S,U,X,Z,AA,AC,AH,AJ,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,AZ,BA,BB,BC,BD,BE,K,O,R,T,V,W,Y,AB,AD,AE,AF,AG,AI,AK;A=$packages["math"];B=$pkg.Vector=$newType(12,$kindSlice,"resolv.Vector",true,"resolv",true,null);C=$pkg.Axis=$newType(4,$kindInt,"resolv.Axis",true,"resolv",true,null);N=$pkg.Space=$newType(0,$kindStruct,"resolv.Space",true,"resolv",true,function(Cells_,CellWidth_,CellHeight_){this.$val=this;if(arguments.length===0){this.Cells=AO.nil;this.CellWidth=0;this.CellHeight=0;return;}this.Cells=Cells_;this.CellWidth=CellWidth_;this.CellHeight=CellHeight_;});P=$pkg.Shape=$newType(8,$kindInterface,"resolv.Shape",true,"resolv",true,null);Q=$pkg.Line=$newType(0,$kindStruct,"resolv.Line",true,"resolv",true,function(Start_,End_){this.$val=this;if(arguments.length===0){this.Start=B.nil;this.End=B.nil;return;}this.Start=Start_;this.End=End_;});S=$pkg.ConvexPolygon=$newType(0,$kindStruct,"resolv.ConvexPolygon",true,"resolv",true,function(Points_,X_,Y_,Closed_){this.$val=this;if(arguments.length===0){this.Points=AT.nil;this.X=0;this.Y=0;this.Closed=false;return;}this.Points=Points_;this.X=X_;this.Y=Y_;this.Closed=Closed_;});U=$pkg.ContactSet=$newType(0,$kindStruct,"resolv.ContactSet",true,"resolv",true,function(Points_,MTV_,Center_){this.$val=this;if(arguments.length===0){this.Points=AS.nil;this.MTV=B.nil;this.Center=B.nil;return;}this.Points=Points_;this.MTV=MTV_;this.Center=Center_;});X=$pkg.Circle=$newType(0,$kindStruct,"resolv.Circle",true,"resolv",true,function(X_,Y_,Radius_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Radius=0;return;}this.X=X_;this.Y=Y_;this.Radius=Radius_;});Z=$pkg.Projection=$newType(0,$kindStruct,"resolv.Projection",true,"resolv",true,function(Min_,Max_){this.$val=this;if(arguments.length===0){this.Min=0;this.Max=0;return;}this.Min=Min_;this.Max=Max_;});AA=$pkg.RingBuffer=$newType(0,$kindStruct,"resolv.RingBuffer",true,"resolv",true,function(Ed_,St_,EdFrameId_,StFrameId_,N_,Cnt_,Eles_){this.$val=this;if(arguments.length===0){this.Ed=0;this.St=0;this.EdFrameId=0;this.StFrameId=0;this.N=0;this.Cnt=0;this.Eles=AZ.nil;return;}this.Ed=Ed_;this.St=St_;this.EdFrameId=EdFrameId_;this.StFrameId=StFrameId_;this.N=N_;this.Cnt=Cnt_;this.Eles=Eles_;});AC=$pkg.Object=$newType(0,$kindStruct,"resolv.Object",true,"resolv",true,function(Shape_,Space_,X_,Y_,W_,H_,TouchingCells_,Data_,ignoreList_,tags_){this.$val=this;if(arguments.length===0){this.Shape=$ifaceNil;this.Space=AP.nil;this.X=0;this.Y=0;this.W=0;this.H=0;this.TouchingCells=AT.nil;this.Data=$ifaceNil;this.ignoreList=false;this.tags=BA.nil;return;}this.Shape=Shape_;this.Space=Space_;this.X=X_;this.Y=Y_;this.W=W_;this.H=H_;this.TouchingCells=TouchingCells_;this.Data=Data_;this.ignoreList=ignoreList_;this.tags=tags_;});AH=$pkg.Collision=$newType(0,$kindStruct,"resolv.Collision",true,"resolv",true,function(checkingObject_,dx_,dy_,Objects_,Cells_){this.$val=this;if(arguments.length===0){this.checkingObject=AQ.nil;this.dx=0;this.dy=0;this.Objects=AT.nil;this.Cells=AT.nil;return;}this.checkingObject=checkingObject_;this.dx=dx_;this.dy=dy_;this.Objects=Objects_;this.Cells=Cells_;});AJ=$pkg.Cell=$newType(0,$kindStruct,"resolv.Cell",true,"resolv",true,function(X_,Y_,Objects_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Objects=AT.nil;return;}this.X=X_;this.Y=Y_;this.Objects=Objects_;});AL=$sliceType($Float64);AM=$ptrType(AJ);AN=$sliceType(AM);AO=$sliceType(AN);AP=$ptrType(N);AQ=$ptrType(AC);AR=$sliceType(AQ);AS=$sliceType(B);AT=$ptrType(AA);AU=$ptrType(Q);AV=$sliceType(AU);AW=$ptrType(X);AX=$ptrType(S);AY=$ptrType(U);AZ=$sliceType($emptyInterface);BA=$sliceType($String);BB=$ptrType(P);BC=$sliceType(C);BD=$ptrType(AH);BE=$mapType(AQ,$Bool);B.prototype.Clone=function(){var a,b;a=this;b=$makeSlice(B,a.$length);$copySlice(b,a);return b;};$ptrType(B).prototype.Clone=function(){return this.$get().Clone();};B.prototype.Add=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AF($convertSliceType(b,AL),1,$convertSliceType(b,AL),$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AL));}else{AF($convertSliceType(b,AL),1,$convertSliceType(b,AL),$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AL));}e++;}return b;};$ptrType(B).prototype.Add=function(a){return this.$get().Add(a);};B.prototype.Sub=function(a){var a,b,c,d,e,f;b=this;c=b.$length;d=a;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]).$length>c){AF($convertSliceType(b,AL),-1,$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),AL),$convertSliceType(b,AL));}else{AF($convertSliceType(b,AL),-1,$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),AL),$convertSliceType(b,AL));}e++;}return b;};$ptrType(B).prototype.Sub=function(a){return this.$get().Sub(a);};B.prototype.Scale=function(a){var a,b;b=this;AG($convertSliceType(b,AL),a,$convertSliceType(b,AL));return b;};$ptrType(B).prototype.Scale=function(a){return this.$get().Scale(a);};B.prototype.Equal=function(a){var a,b,c,d,e;b=this;if(!((b.$length===a.$length))){return false;}c=b;d=0;while(true){if(!(d=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])-((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]))>1e-08){return false;}d++;}return true;};$ptrType(B).prototype.Equal=function(a){return this.$get().Equal(a);};B.prototype.Magnitude=function(){var a;a=this;return A.Sqrt(a.Magnitude2());};$ptrType(B).prototype.Magnitude=function(){return this.$get().Magnitude();};B.prototype.Magnitude2=function(){var a,b,c,d,e;a=this;b=0;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=b+(e*e);d++;}return b;};$ptrType(B).prototype.Magnitude2=function(){return this.$get().Magnitude2();};B.prototype.Unit=function(){var a,b,c,d,e;a=this;b=a.Magnitude();if(b<1e-08){return a;}c=a;d=0;while(true){if(!(d=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e]=((e<0||e>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+e])/b);d++;}return a;};$ptrType(B).prototype.Unit=function(){return this.$get().Unit();};K=function(a,b){var a,b,c,d,e,f,g,h,i,j,k;c=0;d=a.$length;e=b.$length;f=c;g=d;h=e;if(g>h){b=$appendSlice(b,$convertSliceType($makeSlice(B,(g-h>>0)),AL));}if(g>0)),AL));}i=a;j=0;while(true){if(!(j=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+k])*((k<0||k>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+k]));j++;}return f;};$pkg.Dot=K;B.prototype.Dot=function(a){var a,b;b=this;return K(b,a);};$ptrType(B).prototype.Dot=function(a){return this.$get().Dot(a);};B.prototype.Cross=function(a){var a,b;b=this;if(!((b.$length===3))||!((a.$length===3))){return B.nil;}return new B([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]),(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])*(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2])-(2>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+2])*(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])]);};$ptrType(B).prototype.Cross=function(a){return this.$get().Cross(a);};B.prototype.Rotate=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;c=this;d=2;e=c.$length;f=d;g=e;if(g===0){return c;}if(b.$length>0){f=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]);}if((g===1)&&!((f===2))){c=$append(c,0,0);}if((g<2&&(f===2))||((g===2)&&!((f===2)))){c=$append(c,0);}h=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);i=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);j=h;k=i;l=A.Cos(a);m=A.Sin(a);n=l;o=m;p=f;if(p===(0)){q=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=k*n-q*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=k*o+q*n);}else if(p===(1)){r=(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]);(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n+r*o);(2>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+2]=-j*o+r*n);}else if(p===(2)){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=j*n-k*o);(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=j*o+k*n);}if(g>3){return $subslice(c,0,3);}return c;};$ptrType(B).prototype.Rotate=function(a,b){return this.$get().Rotate(a,b);};B.prototype.X=function(){var a;a=this;if(a.$length<1){return 0;}return(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);};$ptrType(B).prototype.X=function(){return this.$get().X();};B.prototype.Y=function(){var a;a=this;if(a.$length<2){return 0;}return(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);};$ptrType(B).prototype.Y=function(){return this.$get().Y();};B.prototype.Z=function(){var a;a=this;if(a.$length<3){return 0;}return(2>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+2]);};$ptrType(B).prototype.Z=function(){return this.$get().Z();};O=function(a,b,c,d){var a,b,c,d,e,f,g;e=new N.ptr(AO.nil,c,d);e.Resize((f=a/c,(f===f&&f!==1/0&&f!==-1/0)?f>>0:$throwRuntimeError("integer divide by zero")),(g=b/d,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero")));return e;};$pkg.NewSpace=O;N.ptr.prototype.AddSingle=function(a){var{a,b,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(b===AP.nil){$panic(new $String("ERROR: space is nil"));}a.Space=b;$r=a.Update();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;}return;}var $f={$blk:N.ptr.prototype.AddSingle,$c:true,$r,a,b,$s};return $f;};N.prototype.AddSingle=function(a){return this.$val.AddSingle(a);};N.ptr.prototype.Add=function(a){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(b===AP.nil){$panic(new $String("ERROR: space is nil"));}c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);e.Space=b;$r=e.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d++;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:N.ptr.prototype.Add,$c:true,$r,a,b,c,d,e,$s};return $f;};N.prototype.Add=function(a){return this.$val.Add(a);};N.ptr.prototype.RemoveSingle=function(a){var a,b,c;b=this;if(b===AP.nil){$panic(new $String("ERROR: space is nil"));}while(true){if(!(0=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);while(true){if(!(0=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+f]));i=0;while(true){if(!(i=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+f])),((j<0||j>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+j])).Objects;n=m.StFrameId;while(true){if(!(n>0;}i++;}e++;}return c;};N.prototype.Objects=function(){return this.$val.Objects();};N.ptr.prototype.Resize=function(a,b){var a,b,c,d,e,f,g,h;c=this;c.Cells=$makeSlice(AO,b);d=0;while(true){if(!(d=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+d]=$makeSlice(AN,a)));f=0;while(true){if(!(f=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+d])),((f<0||f>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+f]=AK(f,d)));f=f+(1)>>0;}d=d+(1)>>0;}};N.prototype.Resize=function(a,b){return this.$val.Resize(a,b);};N.ptr.prototype.Cell=function(a,b){var a,b,c,d,e,f;c=this;if(b>=0&&b=0&&a<(d=c.Cells,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length){return(e=(f=c.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((a<0||a>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+a]));}return AM.nil;};N.prototype.Cell=function(a,b){return this.$val.Cell(a,b);};N.ptr.prototype.CheckCells=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l;f=this;g=a;while(true){if(!(g<(a+c>>0))){break;}h=b;while(true){if(!(h<(b+d>>0))){break;}i=f.Cell(g,h);if(!(i===AM.nil)){j=i.Objects;if(e.$length>0){if(i.ContainsTags(e)){k=j.StFrameId;while(true){if(!(k>0;}}}else if(i.Occupied()){return $assertType(j.GetByFrameId(j.StFrameId),AQ);}}h=h+(1)>>0;}g=g+(1)>>0;}return AQ.nil;};N.prototype.CheckCells=function(a,b,c,d,e){return this.$val.CheckCells(a,b,c,d,e);};N.ptr.prototype.CheckCellsWorld=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l;f=this;g=f.WorldToSpace(a,b);h=g[0];i=g[1];j=f.WorldToSpace(c,d);k=j[0];l=j[1];return f.CheckCells(h,i,k,l,e);};N.prototype.CheckCellsWorld=function(a,b,c,d,e){return this.$val.CheckCellsWorld(a,b,c,d,e);};N.ptr.prototype.UnregisterAllObjects=function(){var a,b,c,d,e,f,g,h,i,j;a=this;b=0;while(true){if(!(b=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])).$length)){break;}g=(e=(f=a.Cells,((b<0||b>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+b])),((c<0||c>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+c]));h=g.Objects;i=h.StFrameId;while(true){if(!(i>0;}c=c+(1)>>0;}b=b+(1)>>0;}};N.prototype.UnregisterAllObjects=function(){return this.$val.UnregisterAllObjects();};N.ptr.prototype.WorldToSpace=function(a,b){var a,b,c,d,e;c=this;d=((A.Floor(a/(c.CellWidth))>>0));e=((A.Floor(b/(c.CellHeight))>>0));return[d,e];};N.prototype.WorldToSpace=function(a,b){return this.$val.WorldToSpace(a,b);};N.ptr.prototype.SpaceToWorld=function(a,b){var a,b,c,d,e;c=this;d=(($imul(a,c.CellWidth)));e=(($imul(b,c.CellHeight)));return[d,e];};N.prototype.SpaceToWorld=function(a,b){return this.$val.SpaceToWorld(a,b);};N.ptr.prototype.Height=function(){var a;a=this;return a.Cells.$length;};N.prototype.Height=function(){return this.$val.Height();};N.ptr.prototype.Width=function(){var a,b;a=this;if(a.Cells.$length>0){return(b=a.Cells,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])).$length;}return 0;};N.prototype.Width=function(){return this.$val.Width();};N.ptr.prototype.CellsInLine=function(a,b,c,d){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;e=this;f=new AN([]);g=e.Cell(a,b);h=e.Cell(c,d);if(!(g===AM.nil)&&!(h===AM.nil)){i=new B([((c-a>>0)),((d-b>>0))]).Unit();(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]=(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])*(((j=e.CellWidth/2,(j===j&&j!==1/0&&j!==-1/0)?j>>0:$throwRuntimeError("integer divide by zero")))));(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]=(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])*(((k=e.CellHeight/2,(k===k&&k!==1/0&&k!==-1/0)?k>>0:$throwRuntimeError("integer divide by zero")))));l=e.SpaceToWorld(a,b);m=l[0];n=l[1];q=new B([m+((o=e.CellWidth/2,(o===o&&o!==1/0&&o!==-1/0)?o>>0:$throwRuntimeError("integer divide by zero"))),n+((p=e.CellHeight/2,(p===p&&p!==1/0&&p!==-1/0)?p>>0:$throwRuntimeError("integer divide by zero")))]);r=false;while(true){if(!(!(g===AM.nil))){break;}if(g===h){f=$append(f,g);break;}f=$append(f,g);if(r){(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]=(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+((1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1])));}else{(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+((0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])));}s=e.WorldToSpace((0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]),(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]));t=s[0];u=s[1];v=e.Cell(t,u);if(!(v===g)){g=v;}r=!r;}}return f;};N.prototype.CellsInLine=function(a,b,c,d){return this.$val.CellsInLine(a,b,c,d);};R=function(a,b,c,d){var a,b,c,d;return new Q.ptr(new B([a,b]),new B([c,d]));};$pkg.NewLine=R;Q.ptr.prototype.Project=function(a){var a,b;b=this;return b.Vector().Scale(a.Dot(b.Start.Sub(new AS([b.End]))));};Q.prototype.Project=function(a){return this.$val.Project(a);};Q.ptr.prototype.Normal=function(){var a,b,c,d,e,f,g;a=this;d=(b=a.End,(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]))-(c=a.Start,(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]));g=(e=a.End,(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))-(f=a.Start,(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]));return new B([d,-g]).Unit();};Q.prototype.Normal=function(){return this.$val.Normal();};Q.ptr.prototype.Vector=function(){var a;a=this;return a.End.Clone().Sub(new AS([a.Start])).Unit();};Q.prototype.Vector=function(){return this.$val.Vector();};Q.ptr.prototype.IntersectionPointsLine=function(a){var a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;b=this;k=((c=b.End,(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]))-(d=b.Start,(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])))*((e=a.End,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(f=a.Start,(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])))-((g=a.End,(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]))-(h=a.Start,(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])))*((i=b.End,(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]))-(j=b.Start,(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1])));if(!((k===0))){t=((((l=b.Start,(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))-(m=a.Start,(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1])))*((n=a.End,(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0]))-(o=a.Start,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))))-(((p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))-(q=a.Start,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])))*((r=a.End,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))-(s=a.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))))+1)/k;ac=((((u=b.Start,(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]))-(v=a.Start,(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])))*((w=b.End,(0>=w.$length?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+0]))-(x=b.Start,(0>=x.$length?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+0]))))-(((y=b.Start,(0>=y.$length?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+0]))-(z=a.Start,(0>=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))*((aa=b.End,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))-(ab=b.Start,(1>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+1]))))+1)/k;if((0=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+0]))-(ae=b.Start,(0>=ae.$length?($throwRuntimeError("index out of range"),undefined):ae.$array[ae.$offset+0]));ai=(ag=b.End,(1>=ag.$length?($throwRuntimeError("index out of range"),undefined):ag.$array[ag.$offset+1]))-(ah=b.Start,(1>=ah.$length?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+1]));return new B([(aj=b.Start,(0>=aj.$length?($throwRuntimeError("index out of range"),undefined):aj.$array[aj.$offset+0]))+(t*af),(ak=b.Start,(1>=ak.$length?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+1]))+(t*ai)]);}}return B.nil;};Q.prototype.IntersectionPointsLine=function(a){return this.$val.IntersectionPointsLine(a);};Q.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;b=this;c=new AS([]);d=new B([a.X,a.Y]);e=b.Start.Sub(new AS([d]));f=b.End.Sub(new AS([d]));g=f.Sub(new AS([e]));h=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])+(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]);i=2*(((0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])));j=((0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])*(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]))+((1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])*(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))-(a.Radius*a.Radius);k=i*i-(4*h*j);if(k<0){}else if(k===0){l=-i/(2*h);if(l>=0&&l<=1){c=$append(c,new B([(m=b.Start,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]))+l*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(n=b.Start,(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1]))+l*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}else{o=(-i+A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new B([(p=b.Start,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(q=b.Start,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}o=(-i-A.Sqrt(k))/(2*h);if(o>=0&&o<=1){c=$append(c,new B([(r=b.Start,(0>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+0]))+o*(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]),(s=b.Start,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]))+o*(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1])]));}}return c;};Q.prototype.IntersectionPointsCircle=function(a){return this.$val.IntersectionPointsCircle(a);};T=function(a){var a,b;b=new S.ptr(AB(6),0,0,true);b.AddPoints(a);return b;};$pkg.NewConvexPolygon=T;S.ptr.prototype.GetPointByOffset=function(a){var a,b;b=this;if(b.Points.Cnt<=a){return B.nil;}return $assertType(b.Points.GetByFrameId(b.Points.StFrameId+a>>0),B);};S.prototype.GetPointByOffset=function(a){return this.$val.GetPointByOffset(a);};S.ptr.prototype.Clone=function(){var a,b,c;a=this;b=T(AL.nil);b.X=a.X;b.Y=a.Y;c=0;while(true){if(!(c>0;}b.Closed=a.Closed;return b;};S.prototype.Clone=function(){return this.$val.Clone();};S.ptr.prototype.AddPoints=function(a){var a,b,c,d;b=this;c=0;while(true){if(!(c=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+c]),(d=c+1>>0,((d<0||d>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+d]))]));c=c+(2)>>0;}};S.prototype.AddPoints=function(a){return this.$val.AddPoints(a);};S.ptr.prototype.UpdateAsRectangle=function(a,b,c,d){var a,b,c,d,e,f,g,h;e=this;if(!((4===e.Points.Cnt))){$panic(new $String("ConvexPolygon not having exactly 4 vertices to form a rectangle#1!"));}f=0;while(true){if(!(f=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]=a);(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]=b);}else if(h===(1)){(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]=a+c);(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]=b);}else if(h===(2)){(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]=a+c);(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]=b+d);}else if(h===(3)){(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]=a);(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]=b+d);}f=f+(1)>>0;}return true;};S.prototype.UpdateAsRectangle=function(a,b,c,d){return this.$val.UpdateAsRectangle(a,b,c,d);};S.ptr.prototype.Lines=function(){var a,b,c,d,e,f,g,h,i,j,k;a=this;b=a.Transformed();c=b.$length;if(!a.Closed){c=c-(1)>>0;}d=$makeSlice(AV,c);e=0;while(true){if(!(e=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e]);g=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]);h=f;i=g;if(e<(b.$length-1>>0)){i=(j=e+1>>0,((j<0||j>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+j]));}k=R((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]),(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]),(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]));((e<0||e>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]=k);e=e+(1)>>0;}return d;};S.prototype.Lines=function(){return this.$val.Lines();};S.ptr.prototype.Transformed=function(){var a,b,c,d;a=this;b=$makeSlice(AS,a.Points.Cnt);c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]=new B([(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])+a.X,(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1])+a.Y]));c=c+(1)>>0;}return b;};S.prototype.Transformed=function(){return this.$val.Transformed();};S.ptr.prototype.Bounds=function(){var a,b,c,d,e,f,g,h;a=this;b=a.Transformed();e=new B([(c=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])),(d=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]),(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]))]);f=e.Clone();g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])<(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])){(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}else if((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])>(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])){(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]));}if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])<(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])){(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}else if((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])>(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])){(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1]));}g=g+(1)>>0;}return[e,f];};S.prototype.Bounds=function(){return this.$val.Bounds();};S.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};S.prototype.Position=function(){return this.$val.Position();};S.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};S.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};S.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};S.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};S.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};S.prototype.Move=function(a,b){return this.$val.Move(a,b);};S.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};S.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};S.ptr.prototype.Center=function(){var a,b,c,d,e,f,g;a=this;b=new B([0,0]);c=a.Transformed();d=c;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);b.Add(new AS([f]));e++;}g=(c.$length);(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])/(g));(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])/(g));return b;};S.prototype.Center=function(){return this.$val.Center();};S.ptr.prototype.Project=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=this;a=a.Unit();c=b.Transformed();f=a.Dot(new B([(d=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0])),(e=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]),(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]))]));g=f;h=1;while(true){if(!(h=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(j=((h<0||h>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+h]),(1>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+1]))]));if(kg){g=k;}h=h+(1)>>0;}return new Z.ptr(f,g);};S.prototype.Project=function(a){return this.$val.Project(a);};S.ptr.prototype.SATAxes=function(){var a,b,c,d,e,f,g;a=this;b=a.Lines();c=$makeSlice(AS,b.$length);d=b;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=g.Normal());e++;}return c;};S.prototype.SATAxes=function(){return this.$val.SATAxes();};S.ptr.prototype.PointInside=function(a){var a,b,c,d,e,f,g;b=this;c=R((0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]),(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]),(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0])+9.99999999999e+11,(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]));d=0;e=b.Lines();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!(g.IntersectionPointsLine(c)===B.nil)){d=d+(1)>>0;}f++;}return d===1;};S.prototype.PointInside=function(a){return this.$val.PointInside(a);};V=function(){return new U.ptr(new AS([]),new B([0,0]),new B([0,0]));};$pkg.NewContactSet=V;U.ptr.prototype.LeftmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])<(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};U.prototype.LeftmostPoint=function(){return this.$val.LeftmostPoint();};U.ptr.prototype.RightmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])>(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])){b=e;}d++;}return b;};U.prototype.RightmostPoint=function(){return this.$val.RightmostPoint();};U.ptr.prototype.TopmostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])<(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};U.prototype.TopmostPoint=function(){return this.$val.TopmostPoint();};U.ptr.prototype.BottommostPoint=function(){var a,b,c,d,e;a=this;b=B.nil;c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(b===B.nil||(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])>(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])){b=e;}d++;}return b;};U.prototype.BottommostPoint=function(){return this.$val.BottommostPoint();};S.ptr.prototype.Intersection=function(a,b,c){var a,aa,ab,ac,ad,ae,af,ag,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;e=V();f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=$assertType(c,AW,true);i=h[0];j=h[1];if(j){k=d.Lines();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);e.Points=$appendSlice(e.Points,m.IntersectionPointsCircle(i));l++;}}else{n=$assertType(c,AX,true);o=n[0];p=n[1];if(p){q=d.Lines();r=0;while(true){if(!(r=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=o.Lines();u=0;while(true){if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);w=s.IntersectionPointsLine(v);if(!(w===B.nil)){e.Points=$append(e.Points,w);}u++;}r++;}}}if(e.Points.$length>0){x=e.Points;y=0;while(true){if(!(y=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+y]);e.Center=e.Center.Add(new AS([z]));y++;}(ab=e.Center,(0>=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0]=(aa=e.Center,(0>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+0]))/((e.Points.$length))));(ad=e.Center,(1>=ad.$length?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+1]=(ac=e.Center,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))/((e.Points.$length))));ae=d.calculateMTV(e,c);if(!(ae===B.nil)){e.MTV=ae;}}else{e=AY.nil;}if(!(e===AY.nil)&&(!((a===0))||!((b===0)))){af=new B([a,b]).Magnitude();ag=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(ag-af);}d.X=f;d.Y=g;return e;};S.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};S.ptr.prototype.calculateMTV=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;c=this;d=new B([0,0]);e=new B([1.7976931348623157e+308,0]);f=b;if($assertType(f,AX,true)[1]){g=f.$val;h=c.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(c.Project(j),Z).Overlapping($clone(g.Project(j),Z))){return B.nil;}k=$clone(c.Project(j),Z).Overlap($clone(g.Project(j),Z));if(e.Magnitude()>k){e=j.Scale(k);}i++;}l=g.SATAxes();m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);if(!$clone(c.Project(n),Z).Overlapping($clone(g.Project(n),Z))){return B.nil;}o=$clone(c.Project(n),Z).Overlap($clone(g.Project(n),Z));if(e.Magnitude()>o){e=n.Scale(o);}m++;}}(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1]));return d;};S.prototype.calculateMTV=function(a,b){return this.$val.calculateMTV(a,b);};S.ptr.prototype.ContainedBy=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;c=a;if($assertType(c,AX,true)[1]){d=c.$val;e=b.SATAxes();f=0;while(true){if(!(f=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+f]);if(!$clone(b.Project(g),Z).IsInside($clone(d.Project(g),Z))){return false;}f++;}h=d.SATAxes();i=0;while(true){if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);if(!$clone(b.Project(j),Z).IsInside($clone(d.Project(j),Z))){return false;}i++;}}return true;};S.prototype.ContainedBy=function(a){return this.$val.ContainedBy(a);};W=function(a,b,c,d){var a,b,c,d;return T(new AL([a,b,a+c,b,a+c,b+d,a,b+d]));};$pkg.NewRectangle=W;Y=function(a,b,c){var a,b,c,d;d=new X.ptr(a,b,c);return d;};$pkg.NewCircle=Y;X.ptr.prototype.Clone=function(){var a;a=this;return Y(a.X,a.Y,a.Radius);};X.prototype.Clone=function(){return this.$val.Clone();};X.ptr.prototype.Bounds=function(){var a;a=this;return[new B([a.X-a.Radius,a.Y-a.Radius]),new B([a.X+a.Radius,a.Y+a.Radius])];};X.prototype.Bounds=function(){return this.$val.Bounds();};X.ptr.prototype.Intersection=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;d=this;e=AY.nil;f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=c;if($assertType(h,AX,true)[1]){i=h.$val;e=i.Intersection(-a,-b,d);if(!(e===AY.nil)){e.MTV=e.MTV.Scale(-1);}}else if($assertType(h,AW,true)[1]){j=h.$val;e=V();e.Points=d.IntersectionPointsCircle(j);if(e.Points.$length===0){return AY.nil;}e.MTV=new B([d.X-j.X,d.Y-j.Y]);k=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(d.Radius+j.Radius-k);l=e.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);e.Center=e.Center.Add(new AS([n]));m++;}(p=e.Center,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]=(o=e.Center,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0]))/((e.Points.$length))));(r=e.Center,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]=(q=e.Center,(1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1]))/((e.Points.$length))));}d.X=f;d.Y=g;return e;};X.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};X.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};X.prototype.Move=function(a,b){return this.$val.Move(a,b);};X.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};X.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};X.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};X.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};X.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};X.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};X.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};X.prototype.Position=function(){return this.$val.Position();};X.ptr.prototype.PointInside=function(a){var a,b;b=this;return a.Sub(new AS([new B([b.X,b.Y])])).Magnitude()<=b.Radius;};X.prototype.PointInside=function(a){return this.$val.PointInside(a);};X.ptr.prototype.IntersectionPointsCircle=function(a){var a,b,c,d,e,f,g;b=this;c=A.Sqrt(A.Pow(a.X-b.X,2)+A.Pow(a.Y-b.Y,2));if(c>b.Radius+a.Radius||c0;};Z.prototype.Overlapping=function(a){return this.$val.Overlapping(a);};Z.ptr.prototype.Overlap=function(a){var a,b;b=this;return A.Min(b.Max,a.Max)-A.Max(b.Min,a.Min);};Z.prototype.Overlap=function(a){return this.$val.Overlap(a);};Z.ptr.prototype.IsInside=function(a){var a,b;b=this;return b.Min>=a.Min&&b.Max<=a.Max;};Z.prototype.IsInside=function(a){return this.$val.IsInside(a);};AB=function(a){var a;return new AA.ptr(0,0,0,0,a,0,$makeSlice(AZ,a));};$pkg.NewRingBuffer=AB;AA.ptr.prototype.DryPut=function(){var a;a=this;while(true){if(!(0=a.N)){break;}a.Pop();}a.EdFrameId=a.EdFrameId+(1)>>0;a.Cnt=a.Cnt+(1)>>0;a.Ed=a.Ed+(1)>>0;if(a.Ed>=a.N){a.Ed=a.Ed-(a.N)>>0;}};AA.prototype.DryPut=function(){return this.$val.DryPut();};AA.ptr.prototype.Put=function(a){var a,b,c,d;b=this;while(true){if(!(0=b.N)){break;}b.Pop();}(c=b.Eles,d=b.Ed,((d<0||d>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]=a));b.EdFrameId=b.EdFrameId+(1)>>0;b.Cnt=b.Cnt+(1)>>0;b.Ed=b.Ed+(1)>>0;if(b.Ed>=b.N){b.Ed=b.Ed-(b.N)>>0;}};AA.prototype.Put=function(a){return this.$val.Put(a);};AA.ptr.prototype.Pop=function(){var a,b,c,d;a=this;if(0===a.Cnt){return $ifaceNil;}d=(b=a.Eles,c=a.St,((c<0||c>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]));a.StFrameId=a.StFrameId+(1)>>0;a.Cnt=a.Cnt-(1)>>0;a.St=a.St+(1)>>0;if(a.St>=a.N){a.St=a.St-(a.N)>>0;}return d;};AA.prototype.Pop=function(){return this.$val.Pop();};AA.ptr.prototype.GetArrIdxByOffset=function(a){var a,b,c;b=this;if((0===b.Cnt)||0>a){return-1;}c=b.St+a>>0;if(b.St=b.N){c=c-(b.N)>>0;}if(c>=b.St||c=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+c]));};AA.prototype.GetByOffset=function(a){return this.$val.GetByOffset(a);};AA.ptr.prototype.GetByFrameId=function(a){var a,b;b=this;if(a>=b.EdFrameId||a>0);};AA.prototype.GetByFrameId=function(a){return this.$val.GetByFrameId(a);};AA.ptr.prototype.SetByFrameId=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;c=this;d=c.StFrameId;e=c.EdFrameId;f=d;g=e;if(bb){h=c.GetArrIdxByOffset(b-c.StFrameId>>0);if(!((-1===h))){(i=c.Eles,((h<0||h>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+h]=a));return[0,f,g];}}j=0;if(g0){f.AddTags(e);}return f;};$pkg.NewObject=AE;AC.ptr.prototype.GetData=function(){var a;a=this;return a.Data;};AC.prototype.GetData=function(){return this.$val.GetData();};AC.ptr.prototype.GetShape=function(){var a;a=this;return(a.$ptr_Shape||(a.$ptr_Shape=new BB(function(){return this.$target.Shape;},function($v){this.$target.Shape=$v;},a)));};AC.prototype.GetShape=function(){return this.$val.GetShape();};AC.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};AC.prototype.Position=function(){return this.$val.Position();};AC.ptr.prototype.Clone=function(){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;b=AE(a.X,a.Y,a.W,a.H,a.Tags());b.Data=a.Data;if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:c=a.Shape.Clone();$s=3;case 3:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=b.SetShape(c);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:d=a.ignoreList;e=0;f=$keys(d);while(true){if(!(e>0;}h=h+(1)>>0;}}if(!($interfaceIsEqual(a.Shape,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:$r=a.Shape.SetPosition(a.X,a.Y);$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AC.ptr.prototype.Update,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};AC.prototype.Update=function(){return this.$val.Update();};AC.ptr.prototype.AddTags=function(a){var a,b;b=this;b.tags=$appendSlice(b.tags,a);};AC.prototype.AddTags=function(a){return this.$val.AddTags(a);};AC.ptr.prototype.RemoveTags=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(i===e){b.tags=$appendSlice($subslice(b.tags,0,h),$subslice(b.tags,(h+1>>0)));break;}g++;}d++;}};AC.prototype.RemoveTags=function(a){return this.$val.RemoveTags(a);};AC.ptr.prototype.HasTags=function(a){var a,b,c,d,e,f,g,h;b=this;c=a;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=b.tags;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return true;}g++;}d++;}return false;};AC.prototype.HasTags=function(a){return this.$val.HasTags(a);};AC.ptr.prototype.Tags=function(){var a;a=this;return $appendSlice(new BA([]),a.tags);};AC.prototype.Tags=function(){return this.$val.Tags();};AC.ptr.prototype.SetShape=function(a){var{a,b,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(!($interfaceIsEqual(b.Shape,a))){$s=1;continue;}$s=2;continue;case 1:b.Shape=a;$r=b.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:$s=-1;return;}return;}var $f={$blk:AC.ptr.prototype.SetShape,$c:true,$r,a,b,$s};return $f;};AC.prototype.SetShape=function(a){return this.$val.SetShape(a);};AC.ptr.prototype.BoundsToSpace=function(a,b){var a,b,c,d,e,f,g,h,i;c=this;d=c.Space.WorldToSpace(c.X+a,c.Y+b);e=d[0];f=d[1];g=c.Space.WorldToSpace(c.X+c.W+a-1,c.Y+c.H+b-1);h=g[0];i=g[1];return[e,f,h,i];};AC.prototype.BoundsToSpace=function(a,b){return this.$val.BoundsToSpace(a,b);};AC.ptr.prototype.SharesCells=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=c.StFrameId;while(true){if(!(d>0;}return false;};AC.prototype.SharesCells=function(a){return this.$val.SharesCells(a);};AC.ptr.prototype.SharesCellsTags=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=c.StFrameId;while(true){if(!(d>0;}return false;};AC.prototype.SharesCellsTags=function(a){return this.$val.SharesCellsTags(a);};AC.ptr.prototype.Center=function(){var a;a=this;return[a.X+(a.W/2),a.Y+(a.H/2)];};AC.prototype.Center=function(){return this.$val.Center();};AC.ptr.prototype.SetCenter=function(a,b){var a,b,c;c=this;c.X=a-(c.W/2);c.Y=b-(c.H/2);};AC.prototype.SetCenter=function(a,b){return this.$val.SetCenter(a,b);};AC.ptr.prototype.CellPosition=function(){var a,b;a=this;b=a.Center();return a.Space.WorldToSpace(b[0],b[1]);};AC.prototype.CellPosition=function(){return this.$val.CellPosition();};AC.ptr.prototype.SetRight=function(a){var a,b;b=this;b.X=a-b.W;};AC.prototype.SetRight=function(a){return this.$val.SetRight(a);};AC.ptr.prototype.SetBottom=function(a){var a,b;b=this;b.Y=a-b.H;};AC.prototype.SetBottom=function(a){return this.$val.SetBottom(a);};AC.ptr.prototype.Bottom=function(){var a;a=this;return a.Y+a.H;};AC.prototype.Bottom=function(){return this.$val.Bottom();};AC.ptr.prototype.Right=function(){var a;a=this;return a.X+a.W;};AC.prototype.Right=function(){return this.$val.Right();};AC.ptr.prototype.SetBounds=function(a,b){var a,b,c;c=this;c.X=(0>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+0]);c.Y=(1>=a.$length?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+1]);c.W=(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])-c.X;c.H=(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1])-c.Y;};AC.prototype.SetBounds=function(a,b){return this.$val.SetBounds(a,b);};AC.ptr.prototype.CheckAllWithHolder=function(a,b,c){var a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;d=this;if(d.Space===AP.nil){return false;}c.Clear();c.checkingObject=d;if(a<0){a=A.Min(a,-1);}else if(a>0){a=A.Max(a,1);}if(b<0){b=A.Min(b,-1);}else if(b>0){b=A.Max(b,1);}c.dx=a;c.dy=b;e=d.BoundsToSpace(a,b);f=e[0];g=e[1];h=e[2];i=e[3];j=$makeMap(AQ.keyFor,[]);k=$makeMap(AM.keyFor,[]);l=g;while(true){if(!(l<=i)){break;}m=f;while(true){if(!(m<=h)){break;}n=d.Space.Cell(m,l);if(!(n===AM.nil)){o=n.Objects;p=o.StFrameId;while(true){if(!(p>0;continue;}t=(u=j[AQ.keyFor(q)],u!==undefined?[u.v,true]:[false,false]);v=t[1];if(!v){c.Objects.Put(q);w=q;(j||$throwRuntimeError("assignment to entry in nil map"))[AQ.keyFor(w)]={k:w,v:true};x=(y=k[AM.keyFor(n)],y!==undefined?[y.v,true]:[false,false]);z=x[1];if(!z){c.Cells.Put(n);aa=n;(k||$throwRuntimeError("assignment to entry in nil map"))[AM.keyFor(aa)]={k:aa,v:true};}p=p+(1)>>0;continue;}p=p+(1)>>0;}}m=m+(1)>>0;}l=l+(1)>>0;}if(0>=c.Objects.Cnt){return false;}return true;};AC.prototype.CheckAllWithHolder=function(a,b,c){return this.$val.CheckAllWithHolder(a,b,c);};AC.ptr.prototype.Overlaps=function(a){var a,b;b=this;return a.X<=b.X+b.W&&a.X+a.W>=b.X&&a.Y<=b.Y+b.H&&a.Y+a.H>=b.Y;};AC.prototype.Overlaps=function(a){return this.$val.Overlaps(a);};AC.ptr.prototype.AddToIgnoreList=function(a){var a,b,c;b=this;c=a;(b.ignoreList||$throwRuntimeError("assignment to entry in nil map"))[AQ.keyFor(c)]={k:c,v:true};};AC.prototype.AddToIgnoreList=function(a){return this.$val.AddToIgnoreList(a);};AC.ptr.prototype.RemoveFromIgnoreList=function(a){var a,b;b=this;delete b.ignoreList[AQ.keyFor(a)];};AC.prototype.RemoveFromIgnoreList=function(a){return this.$val.RemoveFromIgnoreList(a);};AF=function(a,b,c,d){var a,b,c,d,e,f,g,h,i;e=d.$length;f=c;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h===e){return;}((h<0||h>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+h]=b*i+((h<0||h>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+h]));g++;}};AG=function(a,b,c){var a,b,c,d,e,f;d=c;e=0;while(true){if(!(e=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]=((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f])*(b));e++;}};AI=function(){return new AH.ptr(AQ.nil,0,0,AB(16),AB(16));};$pkg.NewCollision=AI;AH.ptr.prototype.Clear=function(){var a;a=this;a.checkingObject=AQ.nil;a.dx=0;a.dy=0;a.Objects.Clear();a.Cells.Clear();};AH.prototype.Clear=function(){return this.$val.Clear();};AH.ptr.prototype.PopFirstCollidedObject=function(){var a;a=this;if(0>=a.Objects.Cnt){return AQ.nil;}return $assertType(a.Objects.Pop(),AQ);};AH.prototype.PopFirstCollidedObject=function(){return this.$val.PopFirstCollidedObject();};AH.ptr.prototype.HasTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=c.StFrameId;while(true){if(!(d>0;continue;}if(e.HasTags(a)){return true;}d=d+(1)>>0;}return false;};AH.prototype.HasTags=function(a){return this.$val.HasTags(a);};AH.ptr.prototype.ObjectsByTags=function(a){var a,b,c,d,e,f;b=this;c=new AR([]);d=b.Objects;e=d.StFrameId;while(true){if(!(e>0;continue;}if(f.HasTags(a)){c=$append(c,f);}e=e+(1)>>0;}return c;};AH.prototype.ObjectsByTags=function(a){return this.$val.ObjectsByTags(a);};AH.ptr.prototype.ContactWithObject=function(a){var a,b,c;b=this;c=new B([0,0]);if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X+a.W-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=a.X-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y+a.H-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=a.Y-b.checkingObject.H-b.checkingObject.Y);}return c;};AH.prototype.ContactWithObject=function(a){return this.$val.ContactWithObject(a);};AH.ptr.prototype.ContactWithCell=function(a){var a,b,c,d,e;b=this;c=new B([0,0]);d=(($imul(a.X,b.checkingObject.Space.CellWidth)));e=(($imul(a.Y,b.checkingObject.Space.CellHeight)));if(b.dx<0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d+(b.checkingObject.Space.CellWidth)-b.checkingObject.X);}else if(b.dx>0){(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]=d-b.checkingObject.W-b.checkingObject.X);}if(b.dy<0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e+(b.checkingObject.Space.CellHeight)-b.checkingObject.Y);}else if(b.dy>0){(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]=e-b.checkingObject.H-b.checkingObject.Y);}return c;};AH.prototype.ContactWithCell=function(a){return this.$val.ContactWithCell(a);};AH.ptr.prototype.SlideAgainstCell=function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;c=this;d=c.checkingObject.Space;e=$assertType(c.Cells.GetByFrameId(c.Cells.StFrameId),AM);f=d.SpaceToWorld(e.X,e.Y);g=f[0];h=f[1];i=(d.CellWidth)/2;j=(d.CellHeight)/2;g=g+(i);h=h+(j);k=c.checkingObject.Center();l=k[0];m=k[1];n=l-g;o=m-h;p=d.Cell(e.X-1>>0,e.Y);q=d.Cell(e.X+1>>0,e.Y);r=d.Cell(e.X,e.Y-1>>0);s=d.Cell(e.X,e.Y+1>>0);t=new B([0,0]);if(!((c.dy===0))){if(n>0&&(q===AM.nil||!q.ContainsTags(b))){(0>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+0]=g+i-c.checkingObject.X);}else if(n<0&&(p===AM.nil||!p.ContainsTags(b))){(0>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+0]=g-i-(c.checkingObject.X+c.checkingObject.W));}else{return B.nil;}}if(!((c.dx===0))){if(o>0&&(s===AM.nil||!s.ContainsTags(b))){(1>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+1]=h+j-c.checkingObject.Y);}else if(o<0&&(r===AM.nil||!r.ContainsTags(b))){(1>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+1]=h-j-(c.checkingObject.Y+c.checkingObject.H));}else{return B.nil;}}return t;};AH.prototype.SlideAgainstCell=function(a,b){return this.$val.SlideAgainstCell(a,b);};AK=function(a,b){var a,b;return new AJ.ptr(a,b,AB(16));};AJ.ptr.prototype.register=function(a){var a,b;b=this;if(!b.Contains(a)){b.Objects.Put(a);}};AJ.prototype.register=function(a){return this.$val.register(a);};AJ.ptr.prototype.unregister=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=c.StFrameId;while(true){if(!(d>0;}};AJ.prototype.unregister=function(a){return this.$val.unregister(a);};AJ.ptr.prototype.Contains=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=c.StFrameId;while(true){if(!(d>0;}return false;};AJ.prototype.Contains=function(a){return this.$val.Contains(a);};AJ.ptr.prototype.ContainsTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=c.StFrameId;while(true){if(!(d>0;}return false;};AJ.prototype.ContainsTags=function(a){return this.$val.ContainsTags(a);};AJ.ptr.prototype.Occupied=function(){var a;a=this;return 0>0))>>2>>0);};$pkg.ConvertToDelayedInputFrameId=AA;AB=function(a){var a;return(a>>2>>0);};$pkg.ConvertToNoDelayInputFrameId=AB;AC=function(a){var a;return(((a<<2>>0))+6>>0);};$pkg.ConvertToFirstUsedRenderFrameId=AC;AD=function(a){var a;return(((((a<<2>>0))+6>>0)+4>>0)-1>>0);};$pkg.ConvertToLastUsedRenderFrameId=AD;AE=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};AG=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new AF.ptr(0,0,0,true,true,new B.Vector([0,0]));i=AH(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,BR.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,BR.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:AG,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};AH=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;d=a.Points.Cnt;e=b.Points.Cnt;f=d;g=e;if((1===f)&&(1===g)){if(!(BR.nil===c)){c.Overlap=0;}h=a.GetPointByOffset(0);i=b.GetPointByOffset(0);return((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])===(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]))&&((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])===(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]));}if(1>0)))){n=a.GetPointByOffset(j+1>>0);}o=(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])-(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1]);p=(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0])-(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]);q=new B.Vector([o,-p]).Unit();if(AN(a,b,q,c)){return false;}j=j+(1)>>0;}}if(1>0)))){v=b.GetPointByOffset(r+1>>0);}w=(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])-(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]);x=(0>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+0])-(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]);y=new B.Vector([w,-x]).Unit();if(AN(a,b,y,c)){return false;}r=r+(1)>>0;}}return true;};AI=function(a,b,c,d,e){var a,b,c,d,e;if(2===a){return false;}return((b+c>>0)>0)+d>>0)>e);};$pkg.IsGeneralBulletActive=AI;AJ=function(a,b){var a,b;return AI(a.BlState,a.BattleAttr.OriginatedRenderFrameId,a.Bullet.StartupFrames,a.Bullet.ActiveFrames,b.Id);};$pkg.IsMeleeBulletActive=AJ;AK=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsMeleeBulletAlive=AK;AL=function(a,b){var a,b;return AI(a.BlState,a.BattleAttr.OriginatedRenderFrameId,a.Bullet.StartupFrames,a.Bullet.ActiveFrames,b.Id);};$pkg.IsFireballBulletActive=AL;AM=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsFireballBulletAlive=AM;AN=function(a,b,c,d){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=0;while(true){if(!(m=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>o){i=o;}if(j>0;}p=0;while(true){if(!(p=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>r){k=r;}if(l>0;}if(i>l||jl){s=i-l;d.AContainedInB=false;}else{v=j-k;w=l-i;if(v=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))&&(0===(aa=d.Axis,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))))||x>y){ab=1;if(s<0){ab=-1;}d.Overlap=y;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ab;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ab;}d.Axis=c;}return false;};AO=function(a,b){var a,b,c,d;c=((A.Round(a*10)>>0));d=((A.Round(b*10)>>0));return[c,d];};$pkg.WorldToVirtualGridPos=AO;AP=function(a,b){var a,b,c,d;c=(a)*0.1;d=(b)*0.1;return[c,d];};$pkg.VirtualGridToWorldPos=AP;AQ=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=AQ;AR=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=AR;AS=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j,k,l,m;k=AR(a,b,c,d,e,f,g,h,i,j);l=k[0];m=k[1];return AO(l,m);};$pkg.PolygonColliderBLToVirtualGridPos=AS;AU=function(a,b,c,d,e,f,g,h,i){var{a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i});$s=$s||0;s:while(true){switch($s){case 0:j=0;if((16===b.CharacterState)&&(0===c.VelX)&&(b.DirX===c.DirX)){k=1;if(0>c.DirX){k=-k;}j=k*(b.Speed)*0.1;}l=0;m=d.CheckAllWithHolder(j,0,i);if(!m){$s=-1;return l;}case 1:n=i.PopFirstCollidedObject();if(BS.nil===n){$s=2;continue;}o=false;p=n.Data;if($assertType(p,BT,true)[1]||$assertType(p,BQ,true)[1]||$assertType(p,BU,true)[1]){}else{o=true;}if(!o){$s=1;continue;}q=$assertType(n.Shape,BV);s=AG(0,0,e,q);$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;t=r[0];u=r[1];v=r[2];w=r[3];if(!t){$s=1;continue;}x=(w.Overlap-f)*w.OverlapX;y=(w.Overlap-f)*w.OverlapY;u=x;v=y;z=w.OverlapX;aa=w.OverlapY;((l<0||l>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+l]).X=z;((l<0||l>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+l]).Y=aa;g.X=g.X+(u);g.Y=g.Y+(v);l=l+(1)>>0;$s=1;continue;case 2:$s=-1;return l;}return;}var $f={$blk:AU,$c:true,$r,a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AV=function(a,b,c,d,e){var a,aa,ab,ac,ad,ae,af,ag,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;f=AA(c.Id);g=AA(c.Id-1>>0);if(0>=f){return[-2,false,0,0];}h=(i=U[$Int32.keyFor(a.CharacterState)],i!==undefined?[i.v,true]:[false,false]);j=h[1];if(j){return[-2,false,0,0];}k=$assertType(e.GetByFrameId(f),BW).InputList;l=BX.nil;if(0>0,((o<0||o>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+o])));q=0;r=0;s=q;t=r;u=0;v=0;w=u;x=v;if(!(BX.nil===l)){z=AE((y=n-1>>0,((y<0||y>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+y])));w=z.BtnALevel;x=z.BtnBLevel;}if(0===a.FramesToRecover){aa=p.Dx;ab=p.Dy;s=aa;t=ab;}ac=-1;ad=a.CapturedByInertia&&(((d.InertiaFramesToRecover>>1>>0))>a.FramesToRecover);if((0===a.FramesToRecover)||ad){if(p.BtnBLevel>x){if(d.DashingEnabled&&0>p.Dy&&!((15===a.CharacterState))){ac=5;}else{ae=(af=T[$Int32.keyFor(a.CharacterState)],af!==undefined?[af.v,true]:[false,false]);ag=ae[1];if(!ag){m=true;}else if(16===a.CharacterState){m=true;}}}}if(-1===ac){if(0w){if(0>p.Dy){ac=3;}else if(0>0;p=n.PlayersArr.$length;q=BY.nil;r=h.GetByFrameId(o);if($interfaceIsEqual($ifaceNil,r)){if(o===h.EdFrameId){h.DryPut();r=h.GetByFrameId(o);if($interfaceIsEqual($ifaceNil,r)){q=BJ(p,64,64);h.SetByFrameId(q,o);}else{q=$assertType(r,BY);}}else{$panic(new $String("Invalid nextRenderFrameId="+($encodeRune(o))+"!"));}}else{q=$assertType(r,BY);}s=q.PlayersArr;t=n.PlayersArr;u=0;while(true){if(!(u=t.$length)?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+u]);x=w.FramesToRecover-1>>0;y=w.FramesInChState+1>>0;z=w.FramesInvinsible-1>>0;if(x<0){x=0;}if(z<0){z=0;}BH(w.Id,w.VirtualGridX,w.VirtualGridY,w.DirX,w.DirY,w.VelX,w.VelY,x,y,w.ActiveSkillId,w.ActiveSkillHit,z,w.Speed,w.BattleState,w.CharacterState,w.JoinIndex,w.Hp,w.MaxHp,w.ColliderRadius,true,false,w.OnWallNormX,w.OnWallNormY,w.CapturedByInertia,w.BulletTeamId,w.ChCollisionTeamId,w.RevivalVirtualGridX,w.RevivalVirtualGridY,((v<0||v>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+v]));u++;}aa=0;ab=q.MeleeBullets;ac=0;ad=q.FireballBullets;ae=n.BulletLocalIdCounter;af=n.PlayersArr;ag=0;case 1:if(!(ag=af.$length)?($throwRuntimeError("index out of range"),undefined):af.$array[af.$offset+ag]);aj=((ah<0||ah>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+ah]);ak=((ah<0||ah>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+ah]);al=AV(ai,ak,n,aj,a);am=al[0];an=al[1];ao=al[2];ap=al[3];((ah<0||ah>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+ah]=an);aq=ai.JoinIndex;ar=aj.SkillMapper(am,ai);$s=3;case 3:if($c){$c=false;ar=ar.$blk();}if(ar&&ar.$blk!==undefined){break s;}as=ar;at=(au=S[$Int.keyFor(as)],au!==undefined?[au.v,true]:[BP.nil,false]);av=at[0];aw=at[1];if(aw){ak.ActiveSkillId=((as>>0));ak.ActiveSkillHit=0;ak.FramesToRecover=av.RecoveryFrames;ax=1;if(0>ak.DirX){ax=-ax;}ay=false;az=(ba=av.Hits,bb=ak.ActiveSkillHit,((bb<0||bb>=ba.$length)?($throwRuntimeError("index out of range"),undefined):ba.$array[ba.$offset+bb]));if($assertType(az,BQ,true)[1]){bc=az.$val;BF(0,0,ae,b,aq,ai.BulletTeamId,bc.Bullet,((aa<0||aa>=ab.$length)?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+aa]));ae=ae+(1)>>0;aa=aa+(1)>>0;if(!((-1===bc.Bullet.SelfLockVelX))){ay=true;ak.VelX=$imul(ax,bc.Bullet.SelfLockVelX);}if(!((-1===bc.Bullet.SelfLockVelY))){ay=true;ak.VelY=bc.Bullet.SelfLockVelY;}}else if($assertType(az,BU,true)[1]){bd=az.$val;BG(0,0,ai.VirtualGridX+($imul(ax,bd.Bullet.HitboxOffsetX))>>0,ai.VirtualGridY+bd.Bullet.HitboxOffsetY>>0,ax,0,$imul(bd.Speed,ax),0,bd.Speed,ae,b,aq,ai.BulletTeamId,bd.Bullet,((ac<0||ac>=ad.$length)?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+ac]));ae=ae+(1)>>0;ac=ac+(1)>>0;if(!((-1===bd.Bullet.SelfLockVelX))){ay=true;ak.VelX=$imul(ax,bd.Bullet.SelfLockVelX);}if(!((-1===bd.Bullet.SelfLockVelY))){ay=true;ak.VelY=bd.Bullet.SelfLockVelY;}}if(false===ay&&false===ai.InAir){ak.VelX=0;}ak.CharacterState=av.BoundChState;ag++;$s=1;continue;}if(0===ai.FramesToRecover){be=ai.CapturedByInertia;bf=aj.OnWallEnabled&&(aj.WallJumpingInitVelX===X(ai.VelX));bg=true;bh=false;bi=false;if(!((0===ao))&&(0===ak.VelX)){bg=false;}else if((0===ao)&&!((0===ak.VelX))){bg=false;bi=true;}else if(0>($imul(ao,ak.VelX))){bg=false;bh=true;}if(!an&&!bf&&!be&&!bg){ak.CapturedByInertia=true;if(bh){ak.CharacterState=17;ak.FramesToRecover=aj.InertiaFramesToRecover;}else if(bi){ak.FramesToRecover=aj.InertiaFramesToRecover;}else{ak.CharacterState=1;ak.FramesToRecover=(((aj.InertiaFramesToRecover>>1>>0))+((aj.InertiaFramesToRecover>>2>>0))>>0);}}else{ak.CapturedByInertia=false;if(!((0===ao))){bj=1;if(0>ao){bj=-bj;}ak.DirX=ao;ak.DirY=ap;if(bf){ak.VelX=$imul(bj,X(ai.VelX));}else{ak.VelX=$imul(bj,ai.Speed);}ak.CharacterState=1;}else{ak.CharacterState=0;ak.VelX=0;}}}ag++;$s=1;continue;case 2:bk=0;bl=n.PlayersArr;bm=0;case 4:if(!(bm=bl.$length)?($throwRuntimeError("index out of range"),undefined):bl.$array[bl.$offset+bm]);bp=bo.JoinIndex;bq=0;br=0;(bs=bp-1>>0,((bs<0||bs>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+bs])).X=bq;(bt=bp-1>>0,((bt<0||bt>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+bt])).Y=br;bu=((bn<0||bn>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+bn]);bv=((bn<0||bn>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+bn]);bw=bo.VirtualGridX+bo.VelX>>0;bx=bo.VirtualGridY+bo.VelY>>0;by=bw;bz=bx;if(0>=bu.Hp&&(0===bu.FramesToRecover)){ca=bo.RevivalVirtualGridX;cb=bo.RevivalVirtualGridY;by=ca;bz=cb;bu.CharacterState=10;bu.FramesInChState=10;bu.FramesToRecover=bv.GetUpFramesToRecover;bu.FramesInvinsible=bv.GetUpInvinsibleFrames;bu.Hp=bo.MaxHp;if(0===((cc=bu.JoinIndex%2,cc===cc?cc:$throwRuntimeError("integer divide by zero")))){bu.DirX=-2;bu.DirY=0;}else{bu.DirX=2;bu.DirY=0;}}if(((bn<0||bn>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+bn])){if(16===bo.CharacterState){if(0<($imul(bo.VelX,bo.OnWallNormX))){by=by-(bo.VelX)>>0;}cd=-1;if(0>bo.OnWallNormX){cd=-cd;}by=by+(($imul(cd,bv.WallJumpingInitVelX)))>>0;bz=bz+(bv.WallJumpingInitVelY)>>0;bu.VelX=(($imul(cd,bv.WallJumpingInitVelX)));bu.VelY=(bv.WallJumpingInitVelY);bu.FramesToRecover=bv.WallJumpingFramesToRecover;}else{bu.VelY=(bv.JumpingInitVelY);bz=bz+(bv.JumpingInitVelY)>>0;}}ce=AP(by,bz);cf=ce[0];cg=ce[1];ch=$imul(bo.ColliderRadius,2);ci=$imul(bo.ColliderRadius,4);cj=ch;ck=ci;cl=bo.CharacterState;if(cl===(9)){cm=$imul(bo.ColliderRadius,4);cn=$imul(bo.ColliderRadius,2);cj=cm;ck=cn;}else if((cl===(8))||(cl===(4))||(cl===(5))||(cl===(16))){co=$imul(bo.ColliderRadius,2);cp=$imul(bo.ColliderRadius,2);cj=co;ck=cp;}cq=AP(cj,ck);cr=cq[0];cs=cq[1];ct=((bk<0||bk>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+bk]);AZ(ct,cf,cg,cr,cs,0.1,0.1,0.1,0.1,e,f,bo,"Player");bk=bk+(1)>>0;$r=c.AddSingle(ct);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(bo.InAir){if((16===bo.CharacterState)&&!((bn<0||bn>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+bn])){bu.VelX=bu.VelX+(0)>>0;bu.VelY=bv.WallSlidingVelY;}else if(15===bo.CharacterState){bu.VelX=bu.VelX+(0)>>0;}else{bu.VelX=bu.VelX+(0)>>0;bu.VelY=bu.VelY+(-5)>>0;}}bm++;$s=4;continue;case 5:cu=n.FireballBullets;cv=0;case 7:if(!(cv=cu.$length)?($throwRuntimeError("index out of range"),undefined):cu.$array[cu.$offset+cv]);if(-1===cw.BattleAttr.BulletLocalId){$s=8;continue;}cx=((ac<0||ac>=ad.$length)?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+ac]);BG(cw.BlState,cw.FramesInBlState+1>>0,cw.VirtualGridX,cw.VirtualGridY,cw.DirX,cw.DirY,cw.VelX,cw.VelY,cw.Speed,cw.BattleAttr.BulletLocalId,cw.BattleAttr.OriginatedRenderFrameId,cw.BattleAttr.OffenderJoinIndex,cw.BattleAttr.TeamId,cw.Bullet,cx);if(AM(cx,n)){$s=9;continue;}$s=10;continue;case 9:if(AL(cx,n)){$s=11;continue;}$s=12;continue;case 11:cy=AP(cx.VirtualGridX,cx.VirtualGridY);cz=cy[0];da=cy[1];db=AP(cx.Bullet.HitboxSizeX,cx.Bullet.HitboxSizeY);dc=db[0];dd=db[1];de=((bk<0||bk>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+bk]);AZ(de,cz,da,dc,dd,0.1,0.1,0.1,0.1,e,f,cx,"FireballBullet");bk=bk+(1)>>0;$r=c.AddSingle(de);$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}cx.BlState=1;if(!((cx.BlState===cw.BlState))){cx.FramesInBlState=0;}df=cx.VirtualGridX+cx.VelX>>0;dg=cx.VirtualGridY+cx.VelY>>0;cx.VirtualGridX=df;cx.VirtualGridY=dg;$s=13;continue;case 12:dj=(dh=n.PlayersArr,di=cx.BattleAttr.OffenderJoinIndex-1>>0,((di<0||di>=dh.$length)?($throwRuntimeError("index out of range"),undefined):dh.$array[dh.$offset+di]));dk=(dl=U[$Int32.keyFor(dj.CharacterState)],dl!==undefined?[dl.v,true]:[false,false]);dm=dk[1];if(dm){cv++;$s=7;continue;}case 13:ac=ac+(1)>>0;case 10:cv++;$s=7;continue;case 8:((ac<0||ac>=ad.$length)?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+ac]).BattleAttr.BulletLocalId=-1;dn=n.MeleeBullets;dp=0;case 15:if(!(dp=dn.$length)?($throwRuntimeError("index out of range"),undefined):dn.$array[dn.$offset+dp]);if(-1===dq.BattleAttr.BulletLocalId){$s=16;continue;}dr=((aa<0||aa>=ab.$length)?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+aa]);BF(dq.BlState,dq.FramesInBlState+1>>0,dq.BattleAttr.BulletLocalId,dq.BattleAttr.OriginatedRenderFrameId,dq.BattleAttr.OffenderJoinIndex,dq.BattleAttr.TeamId,dq.Bullet,dr);if(AK(dr,n)){$s=17;continue;}$s=18;continue;case 17:du=(ds=n.PlayersArr,dt=dr.BattleAttr.OffenderJoinIndex-1>>0,((dt<0||dt>=ds.$length)?($throwRuntimeError("index out of range"),undefined):ds.$array[ds.$offset+dt]));dv=(dw=U[$Int32.keyFor(du.CharacterState)],dw!==undefined?[dw.v,true]:[false,false]);dx=dv[1];if(dx){dp++;$s=15;continue;}if(AJ(dr,n)){$s=19;continue;}$s=20;continue;case 19:dy=1;if(0>du.DirX){dy=-dy;}dz=AP(du.VirtualGridX+($imul(dy,dr.Bullet.HitboxOffsetX))>>0,du.VirtualGridY);ea=dz[0];eb=dz[1];ec=AP(dr.Bullet.HitboxSizeX,dr.Bullet.HitboxSizeY);ed=ec[0];ee=ec[1];ef=((bk<0||bk>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+bk]);AZ(ef,ea,eb,ed,ee,0.1,0.1,0.1,0.1,e,f,dr,"MeleeBullet");bk=bk+(1)>>0;$r=c.AddSingle(ef);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}dr.BlState=1;if(!((dr.BlState===dq.BlState))){dr.FramesInBlState=0;}case 20:aa=aa+(1)>>0;case 18:dp++;$s=15;continue;case 16:((aa<0||aa>=ab.$length)?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+aa]).BattleAttr.BulletLocalId=-1;eg=n.PlayersArr;eh=0;case 22:if(!(eh=eg.$length)?($throwRuntimeError("index out of range"),undefined):eg.$array[eg.$offset+eh]);ek=ej.JoinIndex;el=((ei<0||ei>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+ei]);em=$assertType(el.Shape,BV);en=((ei<0||ei>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+ei]);eq=AU(ek,ej,en,el,em,0.1,(eo=ek-1>>0,((eo<0||eo>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+eo])),(ep=ek-1>>0,((ep<0||ep>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+ep])),i);$s=24;case 24:if($c){$c=false;eq=eq.$blk();}if(eq&&eq.$blk!==undefined){break s;}er=eq;es=((ei<0||ei>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+ei]);et=false;eu=el.CheckAllWithHolder(0,0,i);if(eu){$s=25;continue;}$s=26;continue;case 25:case 27:ev=i.PopFirstCollidedObject();if(BS.nil===ev){$s=28;continue;}ew=false;ex=false;ey=false;ez=ew;fa=ex;fb=ey;fc=ev.Data;if($assertType(fc,BT,true)[1]){fd=fc.$val;if(18===fd.CharacterState){$s=27;continue;}fa=true;}else if($assertType(fc,BQ,true)[1]||$assertType(fc,BU,true)[1]){fe=fc;fb=true;}else{ff=fc;ez=true;}if(fb){$s=27;continue;}fg=$assertType(ev.Shape,BV);fi=AG(0,0,em,fg);$s=29;case 29:if($c){$c=false;fi=fi.$blk();}if(fi&&fi.$blk!==undefined){break s;}fh=fi;fj=fh[0];fk=fh[1];fl=fh[2];fm=fh[3];if(!fj){$s=27;continue;}fn=fm.OverlapX*0+fm.OverlapY*-1;if(fa){fo=(fm.Overlap-0.2)*fm.OverlapX;fp=(fm.Overlap-0.2)*fm.OverlapY;fk=fo;fl=fp;}fq=0;while(true){if(!(fq>0,((fs<0||fs>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+fs])),((fq<0||fq>=fr.$length)?($throwRuntimeError("index out of range"),undefined):fr.$array[fr.$offset+fq]));fu=fk*ft.X+fl*ft.Y;if(ez||(fa&&0>fu)){fk=fk-(fu*ft.X);fl=fl-(fu*ft.Y);}fq=fq+(1)>>0;}fv=ek-1>>0;((fv<0||fv>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fv]).X=((fv<0||fv>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fv]).X+(fk);fw=ek-1>>0;((fw<0||fw>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fw]).Y=((fw<0||fw>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fw]).Y+(fl);if(0.5=ej.VelY;if(fx){en.VelY=0;en.VelX=0;if(18===en.CharacterState){}else if(8===en.CharacterState){en.CharacterState=9;en.FramesToRecover=es.LayDownFramesToRecover;}else{fy=ej.CharacterState;if((fy===(8))||(fy===(4))||(fy===(5))||(fy===(16))){fz=0;ga=ej.ColliderRadius;gb=fz;gc=ga;gd=AP(gb,gc);ge=gd[1];gf=ek-1>>0;((gf<0||gf>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+gf]).Y=((gf<0||gf>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+gf]).Y-(ge);}en.CharacterState=0;en.FramesToRecover=0;}}else{gg=(gh=W[$Int32.keyFor(en.CharacterState)],gh!==undefined?[gh.v,true]:[false,false]);gi=gg[1];if(gi){if(18===en.CharacterState){en.VelY=0;en.VelX=0;}else if(9===en.CharacterState){if(0===en.FramesToRecover){en.CharacterState=10;en.FramesToRecover=es.GetUpFramesToRecover;}}else if(10===en.CharacterState){if(0===en.FramesToRecover){en.CharacterState=0;en.FramesInvinsible=es.GetUpInvinsibleFrames;}}}}}if(es.OnWallEnabled){if(en.InAir){gj=(gk=U[$Int32.keyFor(ej.CharacterState)],gk!==undefined?[gk.v,true]:[false,false]);gl=gj[1];if(!gl){gm=0;while(true){if(!(gm>0,((go<0||go>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+go])),((gm<0||gm>=gn.$length)?($throwRuntimeError("index out of range"),undefined):gn.$array[gn.$offset+gm]));gq=gp.X*1+gp.Y*0;gr=gp.X*-1+gp.Y*0;if(0.9>0));gt=((gp.Y>>0));en.OnWallNormX=gs;en.OnWallNormY=gt;break;}if(0.9>0));gv=((gp.Y>>0));en.OnWallNormX=gu;en.OnWallNormY=gv;break;}gm=gm+(1)>>0;}}}if(!en.OnWall){gw=0;gx=0;en.OnWallNormX=gw;en.OnWallNormY=gx;}}eh++;$s=22;continue;case 23:gy=s.$length;case 30:if(!(gy=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+gy]);ha=gz.CheckAllWithHolder(0,0,i);if(!ha){gy=gy+(1)>>0;$s=30;continue;}hb=false;hc=false;hd=BO.nil;he=BN.nil;hf=gz.Data;if($assertType(hf,BQ,true)[1]){hg=hf.$val;hd=hg.Bullet;he=hg.BattleAttr;}else if($assertType(hf,BU,true)[1]){hh=hf.$val;hd=hh.Bullet;he=hh.BattleAttr;}hi=$assertType(gz.Shape,BV);hl=(hj=n.PlayersArr,hk=he.OffenderJoinIndex-1>>0,((hk<0||hk>=hj.$length)?($throwRuntimeError("index out of range"),undefined):hj.$array[hj.$offset+hk]));case 32:hm=i.PopFirstCollidedObject();if(BS.nil===hm){$s=33;continue;}hn=$assertType(hm.Shape,BV);ho=hm.Data;if($assertType(ho,BT,true)[1]){$s=34;continue;}$s=35;continue;case 34:hp=ho.$val;if(he.OffenderJoinIndex===hp.JoinIndex){$s=32;continue;}hs=AG(0,0,hi,hn);$s=37;case 37:if($c){$c=false;hs=hs.$blk();}if(hs&&hs.$blk!==undefined){break s;}hr=hs;ht=hr[0];if(!ht){$s=32;continue;}hu=(hv=V[$Int32.keyFor(hp.CharacterState)],hv!==undefined?[hv.v,true]:[false,false]);hw=hu[1];if(hw){$s=32;continue;}if(0hl.DirX){hx=-hx;}hz=(hy=hp.JoinIndex-1>>0,((hy<0||hy>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+hy]));hz.Hp=hz.Hp-(hd.Damage)>>0;ia=$imul(hx,hd.PushbackVelX);ib=hd.PushbackVelY;ic=ia;id=ib;hz.VelX=ic;hz.VelY=id;if(0>=hz.Hp){hz.Hp=0;hz.CharacterState=18;hz.FramesToRecover=60;}else{if(hd.BlowUp){hz.CharacterState=8;}else{hz.CharacterState=3;}ig=(ie=hp.JoinIndex-1>>0,((ie<0||ie>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+ie])).FramesToRecover;if(hd.HitStunFrames>ig){hz.FramesToRecover=hd.HitStunFrames;}}$s=36;continue;case 35:hq=ho;hb=true;case 36:$s=32;continue;case 33:if(hb){ih=gz.Data;if($assertType(ih,BQ,true)[1]){ii=ih.$val;ii.BlState=2;if(hc){ii.FramesInBlState=0;}else{ii.FramesInBlState=ii.Bullet.ExplosionFrames+1>>0;}}else if($assertType(ih,BU,true)[1]){ij=ih.$val;ij.BlState=2;ij.FramesInBlState=0;}}gy=gy+(1)>>0;$s=30;continue;case 31:ik=n.PlayersArr;il=0;while(true){if(!(il=ik.$length)?($throwRuntimeError("index out of range"),undefined):ik.$array[ik.$offset+il]);ip=io.JoinIndex;iq=((im<0||im>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+im]);ir=((im<0||im>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+im]);is=AS(iq.X-(it=ip-1>>0,((it<0||it>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+it])).X,iq.Y-(iu=ip-1>>0,((iu<0||iu>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+iu])).Y,iq.W*0.5,iq.H*0.5,0,0,0,0,e,f);ir.VirtualGridX=is[0];ir.VirtualGridY=is[1];if(ir.InAir){iv=ir.CharacterState;iw=iv;if((iw===(0))||(iw===(1))||(iw===(17))){if(((im<0||im>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+im])||(5===io.CharacterState)){ir.CharacterState=5;}else{ir.CharacterState=4;}}else if(iw===(2)){ir.CharacterState=6;}else if(iw===(3)){ir.CharacterState=7;}}if(ir.OnWall){ix=ir.CharacterState;if((ix===(1))||(ix===(5))||(ix===(4))){iy=(16===io.CharacterState);iz=io.OnWall&&12<=ir.FramesInChState;if(iy||iz){ir.CharacterState=16;}}}if(!((ir.CharacterState===io.CharacterState))){ir.FramesInChState=0;}ja=(jb=W[$Int32.keyFor(ir.CharacterState)],jb!==undefined?[jb.v,true]:[false,false]);jc=ja[1];if(jc){ir.ActiveSkillId=-1;ir.ActiveSkillHit=-1;}il++;}jd=0;while(true){if(!(jd=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+jd]);je.Space.RemoveSingle(je);jd=jd+(1)>>0;}q.Id=o;q.BulletLocalIdCounter=ae;$s=-1;return true;}return;}var $f={$blk:AW,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,e,ea,eb,ec,ed,ee,ef,eg,eh,ei,ej,ek,el,em,en,eo,ep,eq,er,es,et,eu,ev,ew,ex,ey,ez,f,fa,fb,fc,fd,fe,ff,fg,fh,fi,fj,fk,fl,fm,fn,fo,fp,fq,fr,fs,ft,fu,fv,fw,fx,fy,fz,g,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj,gk,gl,gm,gn,go,gp,gq,gr,gs,gt,gu,gv,gw,gx,gy,gz,h,ha,hb,hc,hd,he,hf,hg,hh,hi,hj,hk,hl,hm,hn,ho,hp,hq,hr,hs,ht,hu,hv,hw,hx,hy,hz,i,ia,ib,ic,id,ie,ig,ih,ii,ij,ik,il,im,io,ip,iq,ir,is,it,iu,iv,iw,ix,iy,iz,j,ja,jb,jc,jd,je,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=AW;AX=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=AQ(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=AY(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:AX,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=AX;AY=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObjectSingleTag(a,b,c,d,f);h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:AY,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AZ=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;n=AQ(b,c,d*0.5,e*0.5,f,g,h,i,j,k);o=n[0];p=n[1];q=h+d+i;r=g+e+f;s=q;t=r;u=o;v=p;w=s;x=t;a.X=u;a.Y=v;a.W=w;a.H=x;y=$assertType(a.Shape,BV);y.UpdateAsRectangle(0,0,s,t);a.Data=l;};$pkg.UpdateRectCollider=AZ;BA=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=BB(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(BZ.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new BZ([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new CA([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:BA,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=BA;BB=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=BB;BC=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return new K.ptr(u,v,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,w,x,false));};$pkg.NewMeleeBullet=BC;BD=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return new L.ptr(u,v,w,x,y,z,aa,ab,ac,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,ad,ae,false));};$pkg.NewFireballBullet=BD;BE=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return new E.ptr(a,b,c,d,e,f,g,m,n,p,s,false,0,0,h,i,q,r,o,t,u,v,w,x,j,k,l,y,z,aa,ab);};$pkg.NewPlayerDownsync=BE;BF=function(a,b,c,d,e,f,g,h){var a,b,c,d,e,f,g,h;h.BlState=a;h.FramesInBlState=b;h.BattleAttr.BulletLocalId=c;h.BattleAttr.OriginatedRenderFrameId=d;h.BattleAttr.OffenderJoinIndex=e;h.BattleAttr.TeamId=f;h.Bullet=g;};$pkg.CloneMeleeBullet=BF;BG=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;o.BlState=a;o.FramesInBlState=b;o.VirtualGridX=c;o.VirtualGridY=d;o.DirX=e;o.DirY=f;o.VelX=g;o.VelY=h;o.Speed=i;o.BattleAttr.BulletLocalId=j;o.BattleAttr.OriginatedRenderFrameId=k;o.BattleAttr.OffenderJoinIndex=l;o.BattleAttr.TeamId=m;o.Bullet=n;};$pkg.CloneFireballBullet=BG;BH=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac){var a,aa,ab,ac,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;ac.Id=a;ac.VirtualGridX=b;ac.VirtualGridY=c;ac.DirX=d;ac.DirY=e;ac.VelX=f;ac.VelY=g;ac.FramesToRecover=h;ac.FramesInChState=i;ac.ActiveSkillId=j;ac.ActiveSkillHit=k;ac.FramesInvinsible=l;ac.Speed=m;ac.BattleState=n;ac.CharacterState=o;ac.JoinIndex=p;ac.Hp=q;ac.MaxHp=r;ac.ColliderRadius=s;ac.InAir=t;ac.OnWall=u;ac.OnWallNormX=v;ac.OnWallNormY=w;ac.CapturedByInertia=x;ac.BulletTeamId=y;ac.ChCollisionTeamId=z;ac.RevivalVirtualGridX=aa;ac.RevivalVirtualGridY=ab;};$pkg.ClonePlayerDownsync=BH;BI=function(a,b,c,d,e,f){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;f.Id=a;f.BulletLocalIdCounter=c;g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if(BT.nil===h||(-1===h.Id)){break;}BH(h.Id,h.VirtualGridX,h.VirtualGridY,h.DirX,h.DirY,h.VelX,h.VelY,h.FramesToRecover,h.FramesInChState,h.ActiveSkillId,h.ActiveSkillHit,h.FramesInvinsible,h.Speed,h.BattleState,h.CharacterState,h.JoinIndex,h.Hp,h.MaxHp,h.ColliderRadius,h.InAir,h.OnWall,h.OnWallNormX,h.OnWallNormY,h.CapturedByInertia,h.BulletTeamId,h.ChCollisionTeamId,h.RevivalVirtualGridX,h.RevivalVirtualGridY,(i=f.PlayersArr,((g<0||g>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+g])));g=g+(1)>>0;}j=0;while(true){if(!(j=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+j]);if(BQ.nil===k||(-1===k.BattleAttr.BulletLocalId)){break;}BF(k.BlState,k.FramesInBlState,k.BattleAttr.BulletLocalId,k.BattleAttr.OriginatedRenderFrameId,k.BattleAttr.OffenderJoinIndex,k.BattleAttr.TeamId,k.Bullet,(l=f.MeleeBullets,((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])));j=j+(1)>>0;}m=0;while(true){if(!(m=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+m]);if(BU.nil===n||(-1===n.BattleAttr.BulletLocalId)){break;}BG(n.BlState,n.FramesInBlState,n.VirtualGridX,n.VirtualGridY,n.DirX,n.DirY,n.VelX,n.VelY,n.Speed,n.BattleAttr.BulletLocalId,n.BattleAttr.OriginatedRenderFrameId,n.BattleAttr.OffenderJoinIndex,n.BattleAttr.TeamId,n.Bullet,(o=f.FireballBullets,((m<0||m>=o.$length)?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+m])));m=m+(1)>>0;}};$pkg.CloneRoomDownsyncFrame=BI;BJ=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l;d=$makeSlice(CD,a);e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]=f);e=e+(1)>>0;}g=$makeSlice(CE,b);h=0;while(true){if(!(h=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]=i);h=h+(1)>>0;}j=$makeSlice(CF,c);k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]=l);k=k+(1)>>0;}return new N.ptr(-1,d,new $Int64(0,0),g,j,new $Uint64(0,0),false,-1);};$pkg.NewPreallocatedRoomDownsyncFrame=BJ;BT.methods=[{prop:"GetId",name:"GetId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetJoinIndex",name:"GetJoinIndex",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVirtualGridX",name:"GetVirtualGridX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVirtualGridY",name:"GetVirtualGridY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirX",name:"GetDirX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirY",name:"GetDirY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelX",name:"GetVelX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelY",name:"GetVelY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeed",name:"GetSpeed",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHp",name:"GetHp",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetMaxHp",name:"GetMaxHp",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetCharacterState",name:"GetCharacterState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesToRecover",name:"GetFramesToRecover",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesInChState",name:"GetFramesInChState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetInAir",name:"GetInAir",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"GetOnWall",name:"GetOnWall",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"GetOnWallNormX",name:"GetOnWallNormX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetColliderRadius",name:"GetColliderRadius",pkg:"",typ:$funcType([],[$Int32],false)}];BQ.methods=[{prop:"GetBlState",name:"GetBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesInBlState",name:"GetFramesInBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetBulletLocalId",name:"GetBulletLocalId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOffenderJoinIndex",name:"GetOffenderJoinIndex",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOriginatedRenderFrameId",name:"GetOriginatedRenderFrameId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetStartupFrames",name:"GetStartupFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetActiveFrames",name:"GetActiveFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeX",name:"GetHitboxSizeX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeY",name:"GetHitboxSizeY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetX",name:"GetHitboxOffsetX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetY",name:"GetHitboxOffsetY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetExplosionFrames",name:"GetExplosionFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeciesId",name:"GetSpeciesId",pkg:"",typ:$funcType([],[$Int32],false)}];BU.methods=[{prop:"GetVirtualGridX",name:"GetVirtualGridX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVirtualGridY",name:"GetVirtualGridY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirX",name:"GetDirX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirY",name:"GetDirY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelX",name:"GetVelX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelY",name:"GetVelY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeed",name:"GetSpeed",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetBlState",name:"GetBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesInBlState",name:"GetFramesInBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetBulletLocalId",name:"GetBulletLocalId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOffenderJoinIndex",name:"GetOffenderJoinIndex",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOriginatedRenderFrameId",name:"GetOriginatedRenderFrameId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetStartupFrames",name:"GetStartupFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetActiveFrames",name:"GetActiveFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeX",name:"GetHitboxSizeX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeY",name:"GetHitboxSizeY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetX",name:"GetHitboxOffsetX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetY",name:"GetHitboxOffsetY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetExplosionFrames",name:"GetExplosionFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeciesId",name:"GetSpeciesId",pkg:"",typ:$funcType([],[$Int32],false)}];BY.methods=[{prop:"GetId",name:"GetId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetCountdownNanos",name:"GetCountdownNanos",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"GetBackendUnconfirmedMask",name:"GetBackendUnconfirmedMask",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"GetBulletLocalIdCounter",name:"GetBulletLocalIdCounter",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetShouldForceResync",name:"GetShouldForceResync",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"GetPlayersArr",name:"GetPlayersArr",pkg:"",typ:$funcType([],[CD],false)},{prop:"GetMeleeBullets",name:"GetMeleeBullets",pkg:"",typ:$funcType([],[CE],false)},{prop:"GetFireballBullets",name:"GetFireballBullets",pkg:"",typ:$funcType([],[CF],false)}];BW.methods=[{prop:"GetInputFrameId",name:"GetInputFrameId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetInputList",name:"GetInputList",pkg:"",typ:$funcType([],[BX],false)},{prop:"GetConfirmedList",name:"GetConfirmedList",pkg:"",typ:$funcType([],[$Uint64],false)}];CI.methods=[{prop:"GetSpeed",name:"GetSpeed",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeciesId",name:"GetSpeciesId",pkg:"",typ:$funcType([],[$Int],false)},{prop:"GetSpeciesName",name:"GetSpeciesName",pkg:"",typ:$funcType([],[$String],false)}];C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:CB,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:CC,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInChState",name:"FramesInChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWall",name:"OnWall",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallNormX",name:"OnWallNormX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OnWallNormY",name:"OnWallNormY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CapturedByInertia",name:"CapturedByInertia",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"ActiveSkillId",name:"ActiveSkillId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveSkillHit",name:"ActiveSkillHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInvinsible",name:"FramesInvinsible",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BulletTeamId",name:"BulletTeamId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ChCollisionTeamId",name:"ChCollisionTeamId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RevivalVirtualGridX",name:"RevivalVirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RevivalVirtualGridY",name:"RevivalVirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:CG,tag:""}]);I.init("",[{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableStFrame",name:"CancellableStFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableEdFrame",name:"CancellableEdFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelX",name:"PushbackVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelY",name:"PushbackVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelX",name:"SelfLockVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelY",name:"SelfLockVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetX",name:"HitboxOffsetX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetY",name:"HitboxOffsetY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlowUp",name:"BlowUp",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"ExplosionFrames",name:"ExplosionFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancelTransit",name:"CancelTransit",embedded:false,exported:true,typ:CH,tag:""}]);J.init("",[{prop:"BulletLocalId",name:"BulletLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"TeamId",name:"TeamId",embedded:false,exported:true,typ:$Int32,tag:""}]);K.init("",[{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BN,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BO,tag:""}]);L.init("",[{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BN,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BO,tag:""}]);M.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BoundChState",name:"BoundChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hits",name:"Hits",embedded:false,exported:true,typ:BM,tag:""}]);N.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:CD,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:CE,tag:""},{prop:"FireballBullets",name:"FireballBullets",embedded:false,exported:true,typ:CF,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BulletLocalIdCounter",name:"BulletLocalIdCounter",embedded:false,exported:true,typ:$Int32,tag:""}]);O.init("",[{prop:"InputFrameId",name:"InputFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InputList",name:"InputList",embedded:false,exported:true,typ:BX,tag:""},{prop:"ConfirmedList",name:"ConfirmedList",embedded:false,exported:true,typ:$Uint64,tag:""}]);P.init("",[{prop:"FlAct",name:"FlAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"FrAct",name:"FrAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);Q.init([$Int,BT],[$Int],false);R.init("",[{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int,tag:""},{prop:"SpeciesName",name:"SpeciesName",embedded:false,exported:true,typ:$String,tag:""},{prop:"InAirIdleFrameIdxTurningPoint",name:"InAirIdleFrameIdxTurningPoint",embedded:false,exported:true,typ:$Int,tag:""},{prop:"InAirIdleFrameIdxTurnedCycle",name:"InAirIdleFrameIdxTurnedCycle",embedded:false,exported:true,typ:$Int,tag:""},{prop:"LayDownFrames",name:"LayDownFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LayDownFramesToRecover",name:"LayDownFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpInvinsibleFrames",name:"GetUpInvinsibleFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpFramesToRecover",name:"GetUpFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JumpingInitVelY",name:"JumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JumpingFramesToRecover",name:"JumpingFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DashingEnabled",name:"DashingEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallEnabled",name:"OnWallEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"WallJumpingFramesToRecover",name:"WallJumpingFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelX",name:"WallJumpingInitVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelY",name:"WallJumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallSlidingVelY",name:"WallSlidingVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InertiaFramesToRecover",name:"InertiaFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SkillMapper",name:"SkillMapper",embedded:false,exported:true,typ:Q,tag:""}]);AF.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new BL([new BK([0,0]),new BK([0,2]),new BK([0,-2]),new BK([2,0]),new BK([-2,0]),new BK([1,1]),new BK([-1,-1]),new BK([1,-1]),new BK([-1,1])]);S=$makeMap($Int.keyFor,[{k:1,v:new M.ptr(0,30,30,30,1,2,new BM([new K.ptr(0,0,BN.nil,new I.ptr(7,13,30,22,13,9,5,0,5,1,-1,120,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:2}])))]))},{k:2,v:new M.ptr(0,36,36,36,1,11,new BM([new K.ptr(0,0,BN.nil,new I.ptr(18,22,36,18,18,9,5,0,5,1,-1,180,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:3}])))]))},{k:3,v:new M.ptr(0,50,50,50,1,12,new BM([new K.ptr(0,0,BN.nil,new I.ptr(8,0,0,30,999999999,9,20,70,10,5,50,160,80,320,320,true,9,1,false))]))},{k:4,v:new M.ptr(0,30,30,30,1,2,new BM([new K.ptr(0,0,BN.nil,new I.ptr(7,13,30,22,13,9,5,0,5,1,-1,120,0,240,320,false,15,2,$makeMap($Int.keyFor,[{k:1,v:5}])))]))},{k:5,v:new M.ptr(0,36,36,36,1,11,new BM([new K.ptr(0,0,BN.nil,new I.ptr(18,23,36,18,18,9,5,0,5,1,-1,180,0,240,320,false,15,2,$makeMap($Int.keyFor,[{k:1,v:6}])))]))},{k:6,v:new M.ptr(0,45,45,45,1,12,new BM([new K.ptr(0,0,BN.nil,new I.ptr(8,0,0,28,999999999,9,20,30,10,-1,-1,240,0,320,320,true,15,2,false))]))},{k:7,v:new M.ptr(0,30,30,30,1,2,new BM([new K.ptr(0,0,BN.nil,new I.ptr(7,13,30,22,13,9,5,0,5,-1,-1,120,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:8}])))]))},{k:8,v:new M.ptr(0,36,36,36,1,11,new BM([new K.ptr(0,0,BN.nil,new I.ptr(18,22,36,18,18,9,5,0,5,1,-1,180,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:9}])))]))},{k:9,v:new M.ptr(0,40,40,40,1,12,new BM([new K.ptr(0,0,BN.nil,new I.ptr(7,0,0,30,999999999,9,20,40,10,10,-1,100,0,320,320,true,9,1,false))]))},{k:10,v:new M.ptr(0,38,38,38,1,13,new BM([new L.ptr(0,0,0,0,0,0,60,0,0,BN.nil,new I.ptr(10,0,0,999999999,15,9,20,0,22,-1,-1,320,100,640,480,false,30,1,false))]))},{k:11,v:new M.ptr(0,60,60,60,1,14,new BM([new K.ptr(0,0,BN.nil,new I.ptr(3,0,0,25,999999999,9,20,70,35,10,80,80,0,400,640,true,15,3,false))]))},{k:12,v:new M.ptr(0,10,10,10,1,15,new BM([new K.ptr(0,0,BN.nil,new I.ptr(3,0,0,0,0,0,-1,-1,0,60,0,0,0,0,0,false,0,0,false))]))},{k:13,v:new M.ptr(0,12,12,12,1,15,new BM([new K.ptr(0,0,BN.nil,new I.ptr(3,0,0,0,0,0,-1,-1,0,80,0,0,0,0,0,false,0,0,false))]))},{k:14,v:new M.ptr(0,8,8,8,1,15,new BM([new K.ptr(0,0,BN.nil,new I.ptr(4,0,0,0,999999999,0,-1,-1,0,50,0,0,0,0,0,false,0,0,false))]))},{k:15,v:new M.ptr(0,48,48,48,1,13,new BM([new L.ptr(0,0,0,0,0,0,40,0,0,BN.nil,new I.ptr(12,0,0,999999999,15,9,30,0,18,-1,-1,240,80,480,320,false,30,2,false))]))},{k:16,v:new M.ptr(0,60,60,60,1,13,new BM([new L.ptr(0,0,0,0,0,0,40,0,0,BN.nil,new I.ptr(16,0,0,999999999,999999999,9,30,70,30,-1,-1,240,80,480,320,true,30,3,false))]))},{k:255,v:new M.ptr(0,30,30,30,1,6,new BM([new K.ptr(0,0,BN.nil,new I.ptr(3,0,0,20,18,9,5,0,5,-1,-1,120,0,320,240,false,9,1,false))]))},{k:256,v:new M.ptr(0,20,20,20,1,6,new BM([new K.ptr(0,0,BN.nil,new I.ptr(3,0,0,10,15,9,5,0,5,-1,-1,120,0,320,240,false,15,2,false))]))},{k:257,v:new M.ptr(0,30,30,30,1,6,new BM([new K.ptr(0,0,BN.nil,new I.ptr(4,0,0,20,9,5,5,0,5,-1,-1,120,0,320,240,false,9,1,false))]))}]);$pkg.Characters=$makeMap($Int.keyFor,[{k:0,v:new R.ptr(0,"MonkGirl",11,1,16,16,10,27,21,80,2,true,true,8,28,70,-10,9,(function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(1===a){if(0===b.FramesToRecover){if(b.InAir){return 255;}else{return 1;}}else{c=(d=S[$Int.keyFor(((b.ActiveSkillId>>0)))],d!==undefined?[d.v,true]:[BP.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BQ,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BP.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BQ,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BP.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BQ,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]=e);c=c+(1)>>0;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:D,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewDynamicRectangleColliders=D;E=function(){return A.MakeWrapper(C.NewCollision());};$pkg.NewCollisionHolder=E;F=function(a,b,c){var a,b,c;return A.MakeWrapper(new B.InputFrameDownsync.ptr(a,b,c));};$pkg.NewInputFrameDownsync=F;G=function(a){var a;return A.MakeWrapper(C.NewRingBuffer(a));};$pkg.NewRingBufferJs=G;H=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(C.NewSpace(a,b,c,d));};$pkg.NewCollisionSpaceJs=H;I=function(a,b){var a,b;return A.MakeWrapper(new B.Vec2D.ptr(a,b));};$pkg.NewVec2DJs=I;J=function(a,b){var a,b;return A.MakeWrapper(new B.Polygon2D.ptr(a,b));};$pkg.NewPolygon2DJs=J;K=function(a){var a;return A.MakeWrapper(new B.Barrier.ptr(a));};$pkg.NewBarrierJs=K;L=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return A.MakeWrapper(B.NewPlayerDownsync(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab));};$pkg.NewPlayerDownsyncJs=L;M=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return A.MakeWrapper(B.NewMeleeBullet(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x));};$pkg.NewMeleeBulletJs=M;N=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return A.MakeWrapper(B.NewFireballBullet(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae));};$pkg.NewFireballBulletJs=N;O=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(new B.NpcPatrolCue.ptr(a,b,c,d));};$pkg.NewNpcPatrolCue=O;P=function(a,b,c,d,e){var a,b,c,d,e,f;f=B.NewPreallocatedRoomDownsyncFrame(b.$length,64,64);B.CloneRoomDownsyncFrame(a,b,c,d,e,f);return A.MakeWrapper(f);};$pkg.NewRoomDownsyncFrameJs=P;Q=function(a){var a,b,c,d,e,f,g;b=a.Objects();c=$makeSlice(AF,b.$length);d=b;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=A.MakeWrapper(g));e++;}return c;};$pkg.GetCollisionSpaceObjsJs=Q;R=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=B.GenerateConvexPolygonCollider(a,b,c,d,e);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.MakeWrapper(f);$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$s=3;case 3:return h;}return;}var $f={$blk:R,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=R;S=function(a){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=$makeSlice(AF,a.$length,a.$length);c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);h=A.MakeFullWrapper((g=B.Characters[$Int.keyFor(f)],g!==undefined?g.v:AK.nil));$s=3;case 3:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}((e<0||e>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e]=h);d++;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:S,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GetCharacterConfigsOrderedByJoinIndex=S;T=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m});$s=$s||0;s:while(true){switch($s){case 0:n=B.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g,h,i,j,k,l,m);$s=1;case 1:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=2;case 2:return o;}return;}var $f={$blk:T,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=T;U=function(a,b){var a,b,c;c=a.GetByFrameId(b);if($interfaceIsEqual($ifaceNil,c)){return null;}return A.MakeWrapper($assertType(c,AL));};$pkg.GetRoomDownsyncFrame=U;V=function(a,b){var a,b,c;c=a.GetByFrameId(b);if($interfaceIsEqual($ifaceNil,c)){return null;}return A.MakeWrapper($assertType(c,AM));};$pkg.GetInputFrameDownsync=V;W=function(a,b){var a,b,c;return(c=a.InputList,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b]));};$pkg.GetInput=W;X=function(a,b){var a,b;a.InputFrameId=b;return true;};$pkg.SetInputFrameId=X;Y=function(a,b,c){var a,b,c,d;if(b>=a.InputList.$length){return false;}(d=a.InputList,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b]=c));return true;};$pkg.SetInput=Y;Z=function(a,b){var a,b;a.ConfirmedList=b;return true;};$pkg.SetConfirmedList=Z;AA=function(a,b){var a,b,c;return A.MakeWrapper((c=a.PlayersArr,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b])));};$pkg.GetPlayer=AA;AB=function(a,b){var a,b,c,d;if(-1===(c=a.MeleeBullets,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b])).GetBulletLocalId()){return null;}return A.MakeWrapper((d=a.MeleeBullets,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])));};$pkg.GetMeleeBullet=AB;AC=function(a,b){var a,b,c,d;if(-1===(c=a.FireballBullets,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b])).GetBulletLocalId()){return null;}return A.MakeWrapper((d=a.FireballBullets,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])));};$pkg.GetFireballBullet=AC;AD=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new AN(I)},{k:"NewPolygon2DJs",v:new AO(J)},{k:"NewBarrierJs",v:new AP(K)},{k:"NewPlayerDownsyncJs",v:new AQ(L)},{k:"NewMeleeBulletJs",v:new AR(M)},{k:"NewFireballBulletJs",v:new AS(N)},{k:"NewNpcPatrolCue",v:new AT(O)},{k:"NewRoomDownsyncFrameJs",v:new BA(P)},{k:"NewCollisionSpaceJs",v:new BB(H)},{k:"NewCollisionHolder",v:new BC(E)},{k:"NewInputFrameDownsync",v:new BD(F)},{k:"NewRingBufferJs",v:new BE(G)},{k:"GenerateConvexPolygonColliderJs",v:new BF(R)},{k:"GetCollisionSpaceObjsJs",v:new BH(Q)},{k:"WorldToPolygonColliderBLPos",v:new BI(B.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new BI(B.PolygonColliderBLToWorldPos)},{k:"WorldToVirtualGridPos",v:new BJ(B.WorldToVirtualGridPos)},{k:"VirtualGridToWorldPos",v:new BK(B.VirtualGridToWorldPos)},{k:"GetCharacterConfigsOrderedByJoinIndex",v:new BM(S)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new BV(T)},{k:"ConvertToDelayedInputFrameId",v:new BW(B.ConvertToDelayedInputFrameId)},{k:"ConvertToNoDelayInputFrameId",v:new BW(B.ConvertToNoDelayInputFrameId)},{k:"ConvertToFirstUsedRenderFrameId",v:new BW(B.ConvertToFirstUsedRenderFrameId)},{k:"ConvertToLastUsedRenderFrameId",v:new BW(B.ConvertToLastUsedRenderFrameId)},{k:"ShouldGenerateInputFrameUpsync",v:new BX(B.ShouldGenerateInputFrameUpsync)},{k:"IsGeneralBulletActive",v:new BY(B.IsGeneralBulletActive)},{k:"GetRoomDownsyncFrame",v:new BZ(U)},{k:"GetInputFrameDownsync",v:new BZ(V)},{k:"GetPlayer",v:new CA(AA)},{k:"GetMeleeBullet",v:new CA(AB)},{k:"GetFireballBullet",v:new CA(AC)},{k:"GetInput",v:new CB(W)},{k:"NewDynamicRectangleColliders",v:new CC(D)},{k:"SetInputFrameId",v:new CD(X)},{k:"SetInput",v:new CE(Y)},{k:"SetConfirmedList",v:new CF(Z)}]),CG);};$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($pkg===$mainPkg){AD();$mainFinished=true;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["jsexport/battle"]=(function(){var $pkg={},$init,A,B,C,D,E,F,H,I,J,K,L,M,N,O,P,Q,R,AF,BL,BM,BN,BO,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ,CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,S,T,U,V,W,X,Z,AA,AB,AC,AD,AE,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AU,AV,AW,AX,AY,AZ,BA,BB,BC,BD,BE,BF,BG,BH,BI,BJ,BK;A=$packages["math"];B=$packages["resolv"];C=$pkg.Vec2D=$newType(0,$kindStruct,"battle.Vec2D",true,"jsexport/battle",true,function(X_,Y_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;return;}this.X=X_;this.Y=Y_;});D=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=CC.nil;this.Points=CD.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});E=$pkg.PlayerDownsync=$newType(0,$kindStruct,"battle.PlayerDownsync",true,"jsexport/battle",true,function(Id_,VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BattleState_,JoinIndex_,ColliderRadius_,Removed_,Score_,LastMoveGmtMillis_,FramesToRecover_,FramesInChState_,Hp_,MaxHp_,CharacterState_,InAir_,OnWall_,OnWallNormX_,OnWallNormY_,CapturedByInertia_,ActiveSkillId_,ActiveSkillHit_,FramesInvinsible_,BulletTeamId_,ChCollisionTeamId_,RevivalVirtualGridX_,RevivalVirtualGridY_){this.$val=this;if(arguments.length===0){this.Id=0;this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BattleState=0;this.JoinIndex=0;this.ColliderRadius=0;this.Removed=false;this.Score=0;this.LastMoveGmtMillis=0;this.FramesToRecover=0;this.FramesInChState=0;this.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;this.OnWall=false;this.OnWallNormX=0;this.OnWallNormY=0;this.CapturedByInertia=false;this.ActiveSkillId=0;this.ActiveSkillHit=0;this.FramesInvinsible=0;this.BulletTeamId=0;this.ChCollisionTeamId=0;this.RevivalVirtualGridX=0;this.RevivalVirtualGridY=0;return;}this.Id=Id_;this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BattleState=BattleState_;this.JoinIndex=JoinIndex_;this.ColliderRadius=ColliderRadius_;this.Removed=Removed_;this.Score=Score_;this.LastMoveGmtMillis=LastMoveGmtMillis_;this.FramesToRecover=FramesToRecover_;this.FramesInChState=FramesInChState_;this.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;this.OnWall=OnWall_;this.OnWallNormX=OnWallNormX_;this.OnWallNormY=OnWallNormY_;this.CapturedByInertia=CapturedByInertia_;this.ActiveSkillId=ActiveSkillId_;this.ActiveSkillHit=ActiveSkillHit_;this.FramesInvinsible=FramesInvinsible_;this.BulletTeamId=BulletTeamId_;this.ChCollisionTeamId=ChCollisionTeamId_;this.RevivalVirtualGridX=RevivalVirtualGridX_;this.RevivalVirtualGridY=RevivalVirtualGridY_;});F=$pkg.InputFrameDecoded=$newType(0,$kindStruct,"battle.InputFrameDecoded",true,"jsexport/battle",true,function(Dx_,Dy_,BtnALevel_,BtnBLevel_){this.$val=this;if(arguments.length===0){this.Dx=0;this.Dy=0;this.BtnALevel=0;this.BtnBLevel=0;return;}this.Dx=Dx_;this.Dy=Dy_;this.BtnALevel=BtnALevel_;this.BtnBLevel=BtnBLevel_;});H=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=CH.nil;return;}this.Boundary=Boundary_;});I=$pkg.BulletConfig=$newType(0,$kindStruct,"battle.BulletConfig",true,"jsexport/battle",true,function(StartupFrames_,CancellableStFrame_,CancellableEdFrame_,ActiveFrames_,HitStunFrames_,BlockStunFrames_,PushbackVelX_,PushbackVelY_,Damage_,SelfLockVelX_,SelfLockVelY_,HitboxOffsetX_,HitboxOffsetY_,HitboxSizeX_,HitboxSizeY_,BlowUp_,ExplosionFrames_,SpeciesId_,CancelTransit_){this.$val=this;if(arguments.length===0){this.StartupFrames=0;this.CancellableStFrame=0;this.CancellableEdFrame=0;this.ActiveFrames=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.PushbackVelX=0;this.PushbackVelY=0;this.Damage=0;this.SelfLockVelX=0;this.SelfLockVelY=0;this.HitboxOffsetX=0;this.HitboxOffsetY=0;this.HitboxSizeX=0;this.HitboxSizeY=0;this.BlowUp=false;this.ExplosionFrames=0;this.SpeciesId=0;this.CancelTransit=false;return;}this.StartupFrames=StartupFrames_;this.CancellableStFrame=CancellableStFrame_;this.CancellableEdFrame=CancellableEdFrame_;this.ActiveFrames=ActiveFrames_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.PushbackVelX=PushbackVelX_;this.PushbackVelY=PushbackVelY_;this.Damage=Damage_;this.SelfLockVelX=SelfLockVelX_;this.SelfLockVelY=SelfLockVelY_;this.HitboxOffsetX=HitboxOffsetX_;this.HitboxOffsetY=HitboxOffsetY_;this.HitboxSizeX=HitboxSizeX_;this.HitboxSizeY=HitboxSizeY_;this.BlowUp=BlowUp_;this.ExplosionFrames=ExplosionFrames_;this.SpeciesId=SpeciesId_;this.CancelTransit=CancelTransit_;});J=$pkg.BulletBattleAttr=$newType(0,$kindStruct,"battle.BulletBattleAttr",true,"jsexport/battle",true,function(BulletLocalId_,OriginatedRenderFrameId_,OffenderJoinIndex_,TeamId_){this.$val=this;if(arguments.length===0){this.BulletLocalId=0;this.OriginatedRenderFrameId=0;this.OffenderJoinIndex=0;this.TeamId=0;return;}this.BulletLocalId=BulletLocalId_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.OffenderJoinIndex=OffenderJoinIndex_;this.TeamId=TeamId_;});K=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BlState_,FramesInBlState_,BattleAttr_,Bullet_){this.$val=this;if(arguments.length===0){this.BlState=0;this.FramesInBlState=0;this.BattleAttr=BO.nil;this.Bullet=BP.nil;return;}this.BlState=BlState_;this.FramesInBlState=FramesInBlState_;this.BattleAttr=BattleAttr_;this.Bullet=Bullet_;});L=$pkg.FireballBullet=$newType(0,$kindStruct,"battle.FireballBullet",true,"jsexport/battle",true,function(VirtualGridX_,VirtualGridY_,DirX_,DirY_,VelX_,VelY_,Speed_,BlState_,FramesInBlState_,BattleAttr_,Bullet_){this.$val=this;if(arguments.length===0){this.VirtualGridX=0;this.VirtualGridY=0;this.DirX=0;this.DirY=0;this.VelX=0;this.VelY=0;this.Speed=0;this.BlState=0;this.FramesInBlState=0;this.BattleAttr=BO.nil;this.Bullet=BP.nil;return;}this.VirtualGridX=VirtualGridX_;this.VirtualGridY=VirtualGridY_;this.DirX=DirX_;this.DirY=DirY_;this.VelX=VelX_;this.VelY=VelY_;this.Speed=Speed_;this.BlState=BlState_;this.FramesInBlState=FramesInBlState_;this.BattleAttr=BattleAttr_;this.Bullet=Bullet_;});M=$pkg.Skill=$newType(0,$kindStruct,"battle.Skill",true,"jsexport/battle",true,function(BattleLocalId_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,ReleaseTriggerType_,BoundChState_,Hits_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.ReleaseTriggerType=0;this.BoundChState=0;this.Hits=BN.nil;return;}this.BattleLocalId=BattleLocalId_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.ReleaseTriggerType=ReleaseTriggerType_;this.BoundChState=BoundChState_;this.Hits=Hits_;});N=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,FireballBullets_,BackendUnconfirmedMask_,ShouldForceResync_,BulletLocalIdCounter_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=CE.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=CF.nil;this.FireballBullets=CG.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;this.BulletLocalIdCounter=0;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.FireballBullets=FireballBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;this.BulletLocalIdCounter=BulletLocalIdCounter_;});O=$pkg.InputFrameDownsync=$newType(0,$kindStruct,"battle.InputFrameDownsync",true,"jsexport/battle",true,function(InputFrameId_,InputList_,ConfirmedList_){this.$val=this;if(arguments.length===0){this.InputFrameId=0;this.InputList=BY.nil;this.ConfirmedList=new $Uint64(0,0);return;}this.InputFrameId=InputFrameId_;this.InputList=InputList_;this.ConfirmedList=ConfirmedList_;});P=$pkg.NpcPatrolCue=$newType(0,$kindStruct,"battle.NpcPatrolCue",true,"jsexport/battle",true,function(FlAct_,FrAct_,X_,Y_){this.$val=this;if(arguments.length===0){this.FlAct=new $Uint64(0,0);this.FrAct=new $Uint64(0,0);this.X=0;this.Y=0;return;}this.FlAct=FlAct_;this.FrAct=FrAct_;this.X=X_;this.Y=Y_;});Q=$pkg.SkillMapperType=$newType(4,$kindFunc,"battle.SkillMapperType",true,"jsexport/battle",true,null);R=$pkg.CharacterConfig=$newType(0,$kindStruct,"battle.CharacterConfig",true,"jsexport/battle",true,function(SpeciesId_,SpeciesName_,InAirIdleFrameIdxTurningPoint_,InAirIdleFrameIdxTurnedCycle_,LayDownFrames_,LayDownFramesToRecover_,GetUpInvinsibleFrames_,GetUpFramesToRecover_,Speed_,JumpingInitVelY_,JumpingFramesToRecover_,DashingEnabled_,OnWallEnabled_,WallJumpingFramesToRecover_,WallJumpingInitVelX_,WallJumpingInitVelY_,WallSlidingVelY_,InertiaFramesToRecover_,SkillMapper_){this.$val=this;if(arguments.length===0){this.SpeciesId=0;this.SpeciesName="";this.InAirIdleFrameIdxTurningPoint=0;this.InAirIdleFrameIdxTurnedCycle=0;this.LayDownFrames=0;this.LayDownFramesToRecover=0;this.GetUpInvinsibleFrames=0;this.GetUpFramesToRecover=0;this.Speed=0;this.JumpingInitVelY=0;this.JumpingFramesToRecover=0;this.DashingEnabled=false;this.OnWallEnabled=false;this.WallJumpingFramesToRecover=0;this.WallJumpingInitVelX=0;this.WallJumpingInitVelY=0;this.WallSlidingVelY=0;this.InertiaFramesToRecover=0;this.SkillMapper=$throwNilPointerError;return;}this.SpeciesId=SpeciesId_;this.SpeciesName=SpeciesName_;this.InAirIdleFrameIdxTurningPoint=InAirIdleFrameIdxTurningPoint_;this.InAirIdleFrameIdxTurnedCycle=InAirIdleFrameIdxTurnedCycle_;this.LayDownFrames=LayDownFrames_;this.LayDownFramesToRecover=LayDownFramesToRecover_;this.GetUpInvinsibleFrames=GetUpInvinsibleFrames_;this.GetUpFramesToRecover=GetUpFramesToRecover_;this.Speed=Speed_;this.JumpingInitVelY=JumpingInitVelY_;this.JumpingFramesToRecover=JumpingFramesToRecover_;this.DashingEnabled=DashingEnabled_;this.OnWallEnabled=OnWallEnabled_;this.WallJumpingFramesToRecover=WallJumpingFramesToRecover_;this.WallJumpingInitVelX=WallJumpingInitVelX_;this.WallJumpingInitVelY=WallJumpingInitVelY_;this.WallSlidingVelY=WallSlidingVelY_;this.InertiaFramesToRecover=InertiaFramesToRecover_;this.SkillMapper=SkillMapper_;});AF=$pkg.SatResult=$newType(0,$kindStruct,"battle.SatResult",true,"jsexport/battle",true,function(Overlap_,OverlapX_,OverlapY_,AContainedInB_,BContainedInA_,Axis_){this.$val=this;if(arguments.length===0){this.Overlap=0;this.OverlapX=0;this.OverlapY=0;this.AContainedInB=false;this.BContainedInA=false;this.Axis=B.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});BL=$sliceType($Int32);BM=$sliceType(BL);BN=$sliceType($emptyInterface);BO=$ptrType(J);BP=$ptrType(I);BQ=$ptrType(M);BR=$ptrType(K);BS=$ptrType(AF);BT=$ptrType(B.Object);BU=$ptrType(E);BV=$ptrType(L);BW=$ptrType(B.ConvexPolygon);BX=$ptrType(O);BY=$sliceType($Uint64);BZ=$ptrType(N);CA=$sliceType($Float64);CB=$sliceType($String);CC=$ptrType(C);CD=$sliceType(CC);CE=$sliceType(BU);CF=$sliceType(BR);CG=$sliceType(BV);CH=$ptrType(D);CI=$mapType($Int,$Int);CJ=$ptrType(R);R.ptr.prototype.GetSpeed=function(){var a;a=this;return a.Speed;};R.prototype.GetSpeed=function(){return this.$val.GetSpeed();};R.ptr.prototype.GetSpeciesId=function(){var a;a=this;return a.SpeciesId;};R.prototype.GetSpeciesId=function(){return this.$val.GetSpeciesId();};R.ptr.prototype.GetSpeciesName=function(){var a;a=this;return a.SpeciesName;};R.prototype.GetSpeciesName=function(){return this.$val.GetSpeciesName();};O.ptr.prototype.GetInputFrameId=function(){var a;a=this;return a.InputFrameId;};O.prototype.GetInputFrameId=function(){return this.$val.GetInputFrameId();};O.ptr.prototype.GetInputList=function(){var a;a=this;return a.InputList;};O.prototype.GetInputList=function(){return this.$val.GetInputList();};O.ptr.prototype.GetConfirmedList=function(){var a;a=this;return a.ConfirmedList;};O.prototype.GetConfirmedList=function(){return this.$val.GetConfirmedList();};E.ptr.prototype.GetId=function(){var a;a=this;return a.Id;};E.prototype.GetId=function(){return this.$val.GetId();};E.ptr.prototype.GetJoinIndex=function(){var a;a=this;return a.JoinIndex;};E.prototype.GetJoinIndex=function(){return this.$val.GetJoinIndex();};E.ptr.prototype.GetVirtualGridX=function(){var a;a=this;return a.VirtualGridX;};E.prototype.GetVirtualGridX=function(){return this.$val.GetVirtualGridX();};E.ptr.prototype.GetVirtualGridY=function(){var a;a=this;return a.VirtualGridY;};E.prototype.GetVirtualGridY=function(){return this.$val.GetVirtualGridY();};E.ptr.prototype.GetDirX=function(){var a;a=this;return a.DirX;};E.prototype.GetDirX=function(){return this.$val.GetDirX();};E.ptr.prototype.GetDirY=function(){var a;a=this;return a.DirY;};E.prototype.GetDirY=function(){return this.$val.GetDirY();};E.ptr.prototype.GetVelX=function(){var a;a=this;return a.VelX;};E.prototype.GetVelX=function(){return this.$val.GetVelX();};E.ptr.prototype.GetVelY=function(){var a;a=this;return a.VelY;};E.prototype.GetVelY=function(){return this.$val.GetVelY();};E.ptr.prototype.GetSpeed=function(){var a;a=this;return a.Speed;};E.prototype.GetSpeed=function(){return this.$val.GetSpeed();};E.ptr.prototype.GetHp=function(){var a;a=this;return a.Hp;};E.prototype.GetHp=function(){return this.$val.GetHp();};E.ptr.prototype.GetMaxHp=function(){var a;a=this;return a.MaxHp;};E.prototype.GetMaxHp=function(){return this.$val.GetMaxHp();};E.ptr.prototype.GetCharacterState=function(){var a;a=this;return a.CharacterState;};E.prototype.GetCharacterState=function(){return this.$val.GetCharacterState();};E.ptr.prototype.GetFramesToRecover=function(){var a;a=this;return a.FramesToRecover;};E.prototype.GetFramesToRecover=function(){return this.$val.GetFramesToRecover();};E.ptr.prototype.GetFramesInChState=function(){var a;a=this;return a.FramesInChState;};E.prototype.GetFramesInChState=function(){return this.$val.GetFramesInChState();};E.ptr.prototype.GetInAir=function(){var a;a=this;return a.InAir;};E.prototype.GetInAir=function(){return this.$val.GetInAir();};E.ptr.prototype.GetOnWall=function(){var a;a=this;return a.OnWall;};E.prototype.GetOnWall=function(){return this.$val.GetOnWall();};E.ptr.prototype.GetOnWallNormX=function(){var a;a=this;return a.OnWallNormX;};E.prototype.GetOnWallNormX=function(){return this.$val.GetOnWallNormX();};E.ptr.prototype.GetColliderRadius=function(){var a;a=this;return a.ColliderRadius;};E.prototype.GetColliderRadius=function(){return this.$val.GetColliderRadius();};K.ptr.prototype.GetBlState=function(){var a;a=this;return a.BlState;};K.prototype.GetBlState=function(){return this.$val.GetBlState();};K.ptr.prototype.GetFramesInBlState=function(){var a;a=this;return a.FramesInBlState;};K.prototype.GetFramesInBlState=function(){return this.$val.GetFramesInBlState();};K.ptr.prototype.GetBulletLocalId=function(){var a;a=this;return a.BattleAttr.BulletLocalId;};K.prototype.GetBulletLocalId=function(){return this.$val.GetBulletLocalId();};K.ptr.prototype.GetOffenderJoinIndex=function(){var a;a=this;return a.BattleAttr.OffenderJoinIndex;};K.prototype.GetOffenderJoinIndex=function(){return this.$val.GetOffenderJoinIndex();};K.ptr.prototype.GetOriginatedRenderFrameId=function(){var a;a=this;return a.BattleAttr.OriginatedRenderFrameId;};K.prototype.GetOriginatedRenderFrameId=function(){return this.$val.GetOriginatedRenderFrameId();};K.ptr.prototype.GetStartupFrames=function(){var a;a=this;return a.Bullet.StartupFrames;};K.prototype.GetStartupFrames=function(){return this.$val.GetStartupFrames();};K.ptr.prototype.GetActiveFrames=function(){var a;a=this;return a.Bullet.ActiveFrames;};K.prototype.GetActiveFrames=function(){return this.$val.GetActiveFrames();};K.ptr.prototype.GetHitboxSizeX=function(){var a;a=this;return a.Bullet.HitboxSizeX;};K.prototype.GetHitboxSizeX=function(){return this.$val.GetHitboxSizeX();};K.ptr.prototype.GetHitboxSizeY=function(){var a;a=this;return a.Bullet.HitboxSizeY;};K.prototype.GetHitboxSizeY=function(){return this.$val.GetHitboxSizeY();};K.ptr.prototype.GetHitboxOffsetX=function(){var a;a=this;return a.Bullet.HitboxOffsetX;};K.prototype.GetHitboxOffsetX=function(){return this.$val.GetHitboxOffsetX();};K.ptr.prototype.GetHitboxOffsetY=function(){var a;a=this;return a.Bullet.HitboxOffsetY;};K.prototype.GetHitboxOffsetY=function(){return this.$val.GetHitboxOffsetY();};K.ptr.prototype.GetExplosionFrames=function(){var a;a=this;return a.Bullet.ExplosionFrames;};K.prototype.GetExplosionFrames=function(){return this.$val.GetExplosionFrames();};K.ptr.prototype.GetSpeciesId=function(){var a;a=this;return a.Bullet.SpeciesId;};K.prototype.GetSpeciesId=function(){return this.$val.GetSpeciesId();};L.ptr.prototype.GetVirtualGridX=function(){var a;a=this;return a.VirtualGridX;};L.prototype.GetVirtualGridX=function(){return this.$val.GetVirtualGridX();};L.ptr.prototype.GetVirtualGridY=function(){var a;a=this;return a.VirtualGridY;};L.prototype.GetVirtualGridY=function(){return this.$val.GetVirtualGridY();};L.ptr.prototype.GetDirX=function(){var a;a=this;return a.DirX;};L.prototype.GetDirX=function(){return this.$val.GetDirX();};L.ptr.prototype.GetDirY=function(){var a;a=this;return a.DirY;};L.prototype.GetDirY=function(){return this.$val.GetDirY();};L.ptr.prototype.GetVelX=function(){var a;a=this;return a.VelX;};L.prototype.GetVelX=function(){return this.$val.GetVelX();};L.ptr.prototype.GetVelY=function(){var a;a=this;return a.VelY;};L.prototype.GetVelY=function(){return this.$val.GetVelY();};L.ptr.prototype.GetSpeed=function(){var a;a=this;return a.Speed;};L.prototype.GetSpeed=function(){return this.$val.GetSpeed();};L.ptr.prototype.GetBlState=function(){var a;a=this;return a.BlState;};L.prototype.GetBlState=function(){return this.$val.GetBlState();};L.ptr.prototype.GetFramesInBlState=function(){var a;a=this;return a.FramesInBlState;};L.prototype.GetFramesInBlState=function(){return this.$val.GetFramesInBlState();};L.ptr.prototype.GetBulletLocalId=function(){var a;a=this;return a.BattleAttr.BulletLocalId;};L.prototype.GetBulletLocalId=function(){return this.$val.GetBulletLocalId();};L.ptr.prototype.GetOffenderJoinIndex=function(){var a;a=this;return a.BattleAttr.OffenderJoinIndex;};L.prototype.GetOffenderJoinIndex=function(){return this.$val.GetOffenderJoinIndex();};L.ptr.prototype.GetOriginatedRenderFrameId=function(){var a;a=this;return a.BattleAttr.OriginatedRenderFrameId;};L.prototype.GetOriginatedRenderFrameId=function(){return this.$val.GetOriginatedRenderFrameId();};L.ptr.prototype.GetStartupFrames=function(){var a;a=this;return a.Bullet.StartupFrames;};L.prototype.GetStartupFrames=function(){return this.$val.GetStartupFrames();};L.ptr.prototype.GetActiveFrames=function(){var a;a=this;return a.Bullet.ActiveFrames;};L.prototype.GetActiveFrames=function(){return this.$val.GetActiveFrames();};L.ptr.prototype.GetHitboxSizeX=function(){var a;a=this;return a.Bullet.HitboxSizeX;};L.prototype.GetHitboxSizeX=function(){return this.$val.GetHitboxSizeX();};L.ptr.prototype.GetHitboxSizeY=function(){var a;a=this;return a.Bullet.HitboxSizeY;};L.prototype.GetHitboxSizeY=function(){return this.$val.GetHitboxSizeY();};L.ptr.prototype.GetHitboxOffsetX=function(){var a;a=this;return a.Bullet.HitboxOffsetX;};L.prototype.GetHitboxOffsetX=function(){return this.$val.GetHitboxOffsetX();};L.ptr.prototype.GetHitboxOffsetY=function(){var a;a=this;return a.Bullet.HitboxOffsetY;};L.prototype.GetHitboxOffsetY=function(){return this.$val.GetHitboxOffsetY();};L.ptr.prototype.GetExplosionFrames=function(){var a;a=this;return a.Bullet.ExplosionFrames;};L.prototype.GetExplosionFrames=function(){return this.$val.GetExplosionFrames();};L.ptr.prototype.GetSpeciesId=function(){var a;a=this;return a.Bullet.SpeciesId;};L.prototype.GetSpeciesId=function(){return this.$val.GetSpeciesId();};N.ptr.prototype.GetId=function(){var a;a=this;return a.Id;};N.prototype.GetId=function(){return this.$val.GetId();};N.ptr.prototype.GetCountdownNanos=function(){var a;a=this;return a.CountdownNanos;};N.prototype.GetCountdownNanos=function(){return this.$val.GetCountdownNanos();};N.ptr.prototype.GetBackendUnconfirmedMask=function(){var a;a=this;return a.BackendUnconfirmedMask;};N.prototype.GetBackendUnconfirmedMask=function(){return this.$val.GetBackendUnconfirmedMask();};N.ptr.prototype.GetBulletLocalIdCounter=function(){var a;a=this;return a.BulletLocalIdCounter;};N.prototype.GetBulletLocalIdCounter=function(){return this.$val.GetBulletLocalIdCounter();};N.ptr.prototype.GetShouldForceResync=function(){var a;a=this;return a.ShouldForceResync;};N.prototype.GetShouldForceResync=function(){return this.$val.GetShouldForceResync();};N.ptr.prototype.GetPlayersArr=function(){var a;a=this;return a.PlayersArr;};N.prototype.GetPlayersArr=function(){return this.$val.GetPlayersArr();};N.ptr.prototype.GetMeleeBullets=function(){var a;a=this;return a.MeleeBullets;};N.prototype.GetMeleeBullets=function(){return this.$val.GetMeleeBullets();};N.ptr.prototype.GetFireballBullets=function(){var a;a=this;return a.FireballBullets;};N.prototype.GetFireballBullets=function(){return this.$val.GetFireballBullets();};X=function(a){var a;if(a<0){return-a;}return a;};Z=function(a){var a;return(((a&3))===0);};$pkg.ShouldGenerateInputFrameUpsync=Z;AA=function(a){var a;if(a<6){return 0;}return(((a-6>>0))>>2>>0);};$pkg.ConvertToDelayedInputFrameId=AA;AB=function(a){var a;return(a>>2>>0);};$pkg.ConvertToNoDelayInputFrameId=AB;AC=function(a){var a;return(((a<<2>>0))+6>>0);};$pkg.ConvertToFirstUsedRenderFrameId=AC;AD=function(a){var a;return(((((a<<2>>0))+6>>0)+4>>0)-1>>0);};$pkg.ConvertToLastUsedRenderFrameId=AD;AE=function(a){var a,b,c,d,e,f,g,h;b=new $Uint64(a.$high&0,(a.$low&15)>>>0);d=(((c=$shiftRightUint64(a,4),new $Uint64(c.$high&0,(c.$low&1)>>>0)).$low>>0));f=(((e=$shiftRightUint64(a,5),new $Uint64(e.$high&0,(e.$low&1)>>>0)).$low>>0));return new F.ptr((g=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0])),(h=(($flatten64(b)<0||$flatten64(b)>=$pkg.DIRECTION_DECODER.$length)?($throwRuntimeError("index out of range"),undefined):$pkg.DIRECTION_DECODER.$array[$pkg.DIRECTION_DECODER.$offset+$flatten64(b)]),(1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])),d,f);};AG=function(a,b,c,d){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];e=[e];f=[f];g=c[0].Position();e[0]=g[0];f[0]=g[1];$deferred.push([(function(c,e,f){return function(){c[0].SetPosition(e[0],f[0]);};})(c,e,f),[]]);c[0].SetPosition(e[0]+a,f[0]+b);h=new AF.ptr(0,0,0,true,true,new B.Vector([0,0]));i=AH(c[0],d,h);if(i){$s=1;continue;}$s=2;continue;case 1:j=h.Overlap*h.OverlapX;k=h.Overlap*h.OverlapY;l=j;m=k;n=[true,l,m,h];$s=4;case 4:return n;case 2:o=[false,0,0,h];$s=5;case 5:return o;case 3:$s=-1;return[false,0,0,BS.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,BS.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:AG,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};AH=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;d=a.Points.Cnt;e=b.Points.Cnt;f=d;g=e;if((1===f)&&(1===g)){if(!(BS.nil===c)){c.Overlap=0;}h=a.GetPointByOffset(0);i=b.GetPointByOffset(0);return((0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0])===(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0]))&&((1>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+1])===(1>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+1]));}if(1>0)))){n=a.GetPointByOffset(j+1>>0);}o=(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])-(1>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+1]);p=(0>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0])-(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]);q=new B.Vector([o,-p]).Unit();if(AN(a,b,q,c)){return false;}j=j+(1)>>0;}}if(1>0)))){v=b.GetPointByOffset(r+1>>0);}w=(1>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+1])-(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]);x=(0>=v.$length?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+0])-(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]);y=new B.Vector([w,-x]).Unit();if(AN(a,b,y,c)){return false;}r=r+(1)>>0;}}return true;};AI=function(a,b,c,d,e){var a,b,c,d,e;if(2===a){return false;}return((b+c>>0)>0)+d>>0)>e);};$pkg.IsGeneralBulletActive=AI;AJ=function(a,b){var a,b;return AI(a.BlState,a.BattleAttr.OriginatedRenderFrameId,a.Bullet.StartupFrames,a.Bullet.ActiveFrames,b.Id);};$pkg.IsMeleeBulletActive=AJ;AK=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsMeleeBulletAlive=AK;AL=function(a,b){var a,b;return AI(a.BlState,a.BattleAttr.OriginatedRenderFrameId,a.Bullet.StartupFrames,a.Bullet.ActiveFrames,b.Id);};$pkg.IsFireballBulletActive=AL;AM=function(a,b){var a,b;if(2===a.BlState){return a.FramesInBlState>0)+a.Bullet.ActiveFrames>>0)>b.Id;};$pkg.IsFireballBulletAlive=AM;AN=function(a,b,c,d){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;e=1.7e+308;f=-1.7e+308;g=1.7e+308;h=-1.7e+308;i=e;j=f;k=g;l=h;m=0;while(true){if(!(m=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>o){i=o;}if(j>0;}p=0;while(true){if(!(p=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>r){k=r;}if(l>0;}if(i>l||jl){s=i-l;d.AContainedInB=false;}else{v=j-k;w=l-i;if(v=z.$length?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+0])))&&(0===(aa=d.Axis,(1>=aa.$length?($throwRuntimeError("index out of range"),undefined):aa.$array[aa.$offset+1]))))||x>y){ab=1;if(s<0){ab=-1;}d.Overlap=y;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ab;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ab;}d.Axis=c;}return false;};AO=function(a,b){var a,b,c,d;c=((A.Round(a*10)>>0));d=((A.Round(b*10)>>0));return[c,d];};$pkg.WorldToVirtualGridPos=AO;AP=function(a,b){var a,b,c,d;c=(a)*0.1;d=(b)*0.1;return[c,d];};$pkg.VirtualGridToWorldPos=AP;AQ=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a-c-g+i,b-d-f+j];};$pkg.WorldToPolygonColliderBLPos=AQ;AR=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j;return[a+c+g-i,b+d+f-j];};$pkg.PolygonColliderBLToWorldPos=AR;AS=function(a,b,c,d,e,f,g,h,i,j){var a,b,c,d,e,f,g,h,i,j,k,l,m;k=AR(a,b,c,d,e,f,g,h,i,j);l=k[0];m=k[1];return AO(l,m);};$pkg.PolygonColliderBLToVirtualGridPos=AS;AU=function(a,b,c,d,e,f,g,h,i){var{a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i});$s=$s||0;s:while(true){switch($s){case 0:j=0;if((16===b.CharacterState)&&(0===c.VelX)&&(b.DirX===c.DirX)){k=1;if(0>c.DirX){k=-k;}j=k*(b.Speed)*0.1;}l=0;m=d.CheckAllWithHolder(j,0,i);if(!m){$s=-1;return l;}case 1:n=i.PopFirstCollidedObject();if(BT.nil===n){$s=2;continue;}o=false;p=n.Data;if($assertType(p,BU,true)[1]||$assertType(p,BR,true)[1]||$assertType(p,BV,true)[1]){}else{o=true;}if(!o){$s=1;continue;}q=$assertType(n.Shape,BW);s=AG(0,0,e,q);$s=3;case 3:if($c){$c=false;s=s.$blk();}if(s&&s.$blk!==undefined){break s;}r=s;t=r[0];u=r[1];v=r[2];w=r[3];if(!t){$s=1;continue;}x=(w.Overlap-f)*w.OverlapX;y=(w.Overlap-f)*w.OverlapY;u=x;v=y;z=w.OverlapX;aa=w.OverlapY;((l<0||l>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+l]).X=z;((l<0||l>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+l]).Y=aa;g.X=g.X+(u);g.Y=g.Y+(v);l=l+(1)>>0;$s=1;continue;case 2:$s=-1;return l;}return;}var $f={$blk:AU,$c:true,$r,a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};AV=function(a,b,c,d,e,f){var a,b,c,d,e,f,g,h,i;g=0;while(true){if(!(g>>0))),new $Uint64(c.$high&i.$high,(c.$low&i.$low)>>>0)),(0===h.$high&&0===h.$low))){if(((g<0||g>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+g])=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+g]=((g<0||g>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]));}}g=g+(1)>>0;}};AW=function(a,b,c,d,e,f,g){var a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;h=AA(c.Id);i=AA(c.Id-1>>0);if(0>=h){return[-2,false,0,0];}j=(k=U[$Int32.keyFor(a.CharacterState)],k!==undefined?[k.v,true]:[false,false]);l=j[1];if(l){return[-2,false,0,0];}m=$assertType(e.GetByFrameId(h),BX);n=m.InputList;o=n.$length;AV(h,o,m.ConfirmedList,n,f,g);p=BY.nil;if(0>0,((t<0||t>=n.$length)?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+t])));v=0;w=0;x=v;y=w;z=0;aa=0;ab=z;ac=aa;if(!(BY.nil===p)){ae=AE((ad=s-1>>0,((ad<0||ad>=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+ad])));ab=ae.BtnALevel;ac=ae.BtnBLevel;}if(0===a.FramesToRecover){af=u.Dx;ag=u.Dy;x=af;y=ag;}ah=-1;ai=a.CapturedByInertia&&(((d.InertiaFramesToRecover>>1>>0))>a.FramesToRecover);if((0===a.FramesToRecover)||ai){if(u.BtnBLevel>ac){if(d.DashingEnabled&&0>u.Dy&&!((15===a.CharacterState))){ah=5;}else{aj=(ak=T[$Int32.keyFor(a.CharacterState)],ak!==undefined?[ak.v,true]:[false,false]);al=aj[1];if(!al){r=true;}else if(16===a.CharacterState){r=true;}}}}if(-1===ah){if(0ab){if(0>u.Dy){ah=3;}else if(0>0;r=p.PlayersArr.$length;s=BZ.nil;t=h.GetByFrameId(q);if($interfaceIsEqual($ifaceNil,t)){if(q===h.EdFrameId){h.DryPut();t=h.GetByFrameId(q);if($interfaceIsEqual($ifaceNil,t)){s=BK(r,64,64);h.SetByFrameId(s,q);}else{s=$assertType(t,BZ);}}else{$panic(new $String("Invalid nextRenderFrameId="+($encodeRune(q))+"!"));}}else{s=$assertType(t,BZ);}u=s.PlayersArr;v=p.PlayersArr;w=0;while(true){if(!(w=v.$length)?($throwRuntimeError("index out of range"),undefined):v.$array[v.$offset+w]);z=y.FramesToRecover-1>>0;aa=y.FramesInChState+1>>0;ab=y.FramesInvinsible-1>>0;if(z<0){z=0;}if(ab<0){ab=0;}BI(y.Id,y.VirtualGridX,y.VirtualGridY,y.DirX,y.DirY,y.VelX,y.VelY,z,aa,y.ActiveSkillId,y.ActiveSkillHit,ab,y.Speed,y.BattleState,y.CharacterState,y.JoinIndex,y.Hp,y.MaxHp,y.ColliderRadius,true,false,y.OnWallNormX,y.OnWallNormY,y.CapturedByInertia,y.BulletTeamId,y.ChCollisionTeamId,y.RevivalVirtualGridX,y.RevivalVirtualGridY,((x<0||x>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+x]));w++;}ac=0;ad=s.MeleeBullets;ae=0;af=s.FireballBullets;ag=p.BulletLocalIdCounter;ah=p.PlayersArr;ai=0;case 1:if(!(ai=ah.$length)?($throwRuntimeError("index out of range"),undefined):ah.$array[ah.$offset+ai]);al=((aj<0||aj>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+aj]);am=((aj<0||aj>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+aj]);an=AW(ak,am,p,al,a,n,o);ao=an[0];ap=an[1];aq=an[2];ar=an[3];((aj<0||aj>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+aj]=ap);as=ak.JoinIndex;at=al.SkillMapper(ao,ak);$s=3;case 3:if($c){$c=false;at=at.$blk();}if(at&&at.$blk!==undefined){break s;}au=at;av=(aw=S[$Int.keyFor(au)],aw!==undefined?[aw.v,true]:[BQ.nil,false]);ax=av[0];ay=av[1];if(ay){am.ActiveSkillId=((au>>0));am.ActiveSkillHit=0;am.FramesToRecover=ax.RecoveryFrames;az=1;if(0>am.DirX){az=-az;}ba=false;bb=(bc=ax.Hits,bd=am.ActiveSkillHit,((bd<0||bd>=bc.$length)?($throwRuntimeError("index out of range"),undefined):bc.$array[bc.$offset+bd]));if($assertType(bb,BR,true)[1]){be=bb.$val;BG(0,0,ag,b,as,ak.BulletTeamId,be.Bullet,((ac<0||ac>=ad.$length)?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+ac]));ag=ag+(1)>>0;ac=ac+(1)>>0;if(!((-1===be.Bullet.SelfLockVelX))){ba=true;am.VelX=$imul(az,be.Bullet.SelfLockVelX);}if(!((-1===be.Bullet.SelfLockVelY))){ba=true;am.VelY=be.Bullet.SelfLockVelY;}}else if($assertType(bb,BV,true)[1]){bf=bb.$val;BH(0,0,ak.VirtualGridX+($imul(az,bf.Bullet.HitboxOffsetX))>>0,ak.VirtualGridY+bf.Bullet.HitboxOffsetY>>0,az,0,$imul(bf.Speed,az),0,bf.Speed,ag,b,as,ak.BulletTeamId,bf.Bullet,((ae<0||ae>=af.$length)?($throwRuntimeError("index out of range"),undefined):af.$array[af.$offset+ae]));ag=ag+(1)>>0;ae=ae+(1)>>0;if(!((-1===bf.Bullet.SelfLockVelX))){ba=true;am.VelX=$imul(az,bf.Bullet.SelfLockVelX);}if(!((-1===bf.Bullet.SelfLockVelY))){ba=true;am.VelY=bf.Bullet.SelfLockVelY;}}if(false===ba&&false===ak.InAir){am.VelX=0;}am.CharacterState=ax.BoundChState;ai++;$s=1;continue;}if(0===ak.FramesToRecover){bg=ak.CapturedByInertia;bh=al.OnWallEnabled&&(al.WallJumpingInitVelX===X(ak.VelX));bi=true;bj=false;bk=false;if(!((0===aq))&&(0===am.VelX)){bi=false;}else if((0===aq)&&!((0===am.VelX))){bi=false;bk=true;}else if(0>($imul(aq,am.VelX))){bi=false;bj=true;}if(!ap&&!bh&&!bg&&!bi){am.CapturedByInertia=true;if(bj){am.CharacterState=17;am.FramesToRecover=al.InertiaFramesToRecover;}else if(bk){am.FramesToRecover=al.InertiaFramesToRecover;}else{am.CharacterState=1;am.FramesToRecover=(((al.InertiaFramesToRecover>>1>>0))+((al.InertiaFramesToRecover>>2>>0))>>0);}}else{am.CapturedByInertia=false;if(!((0===aq))){bl=1;if(0>aq){bl=-bl;}am.DirX=aq;am.DirY=ar;if(bh){am.VelX=$imul(bl,X(ak.VelX));}else{am.VelX=$imul(bl,ak.Speed);}am.CharacterState=1;}else{am.CharacterState=0;am.VelX=0;}}}ai++;$s=1;continue;case 2:bm=0;bn=p.PlayersArr;bo=0;case 4:if(!(bo=bn.$length)?($throwRuntimeError("index out of range"),undefined):bn.$array[bn.$offset+bo]);br=bq.JoinIndex;bs=0;bt=0;(bu=br-1>>0,((bu<0||bu>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+bu])).X=bs;(bv=br-1>>0,((bv<0||bv>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+bv])).Y=bt;bw=((bp<0||bp>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+bp]);bx=((bp<0||bp>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+bp]);by=bq.VirtualGridX+bq.VelX>>0;bz=bq.VirtualGridY+bq.VelY>>0;ca=by;cb=bz;if(0>=bw.Hp&&(0===bw.FramesToRecover)){cc=bq.RevivalVirtualGridX;cd=bq.RevivalVirtualGridY;ca=cc;cb=cd;bw.CharacterState=10;bw.FramesInChState=10;bw.FramesToRecover=bx.GetUpFramesToRecover;bw.FramesInvinsible=bx.GetUpInvinsibleFrames;bw.Hp=bq.MaxHp;if(0===((ce=bw.JoinIndex%2,ce===ce?ce:$throwRuntimeError("integer divide by zero")))){bw.DirX=-2;bw.DirY=0;}else{bw.DirX=2;bw.DirY=0;}}if(((bp<0||bp>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+bp])){if(16===bq.CharacterState){if(0<($imul(bq.VelX,bq.OnWallNormX))){ca=ca-(bq.VelX)>>0;}cf=-1;if(0>bq.OnWallNormX){cf=-cf;}ca=ca+(($imul(cf,bx.WallJumpingInitVelX)))>>0;cb=cb+(bx.WallJumpingInitVelY)>>0;bw.VelX=(($imul(cf,bx.WallJumpingInitVelX)));bw.VelY=(bx.WallJumpingInitVelY);bw.FramesToRecover=bx.WallJumpingFramesToRecover;}else{bw.VelY=(bx.JumpingInitVelY);cb=cb+(bx.JumpingInitVelY)>>0;}}cg=AP(ca,cb);ch=cg[0];ci=cg[1];cj=$imul(bq.ColliderRadius,2);ck=$imul(bq.ColliderRadius,4);cl=cj;cm=ck;cn=bq.CharacterState;if(cn===(9)){co=$imul(bq.ColliderRadius,4);cp=$imul(bq.ColliderRadius,2);cl=co;cm=cp;}else if((cn===(8))||(cn===(4))||(cn===(5))||(cn===(16))){cq=$imul(bq.ColliderRadius,2);cr=$imul(bq.ColliderRadius,2);cl=cq;cm=cr;}cs=AP(cl,cm);ct=cs[0];cu=cs[1];cv=((bm<0||bm>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+bm]);BA(cv,ch,ci,ct,cu,0.1,0.1,0.1,0.1,e,f,bq,"Player");bm=bm+(1)>>0;$r=c.AddSingle(cv);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(bq.InAir){if((16===bq.CharacterState)&&!((bp<0||bp>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+bp])){bw.VelX=bw.VelX+(0)>>0;bw.VelY=bx.WallSlidingVelY;}else if(15===bq.CharacterState){bw.VelX=bw.VelX+(0)>>0;}else{bw.VelX=bw.VelX+(0)>>0;bw.VelY=bw.VelY+(-5)>>0;}}bo++;$s=4;continue;case 5:cw=p.FireballBullets;cx=0;case 7:if(!(cx=cw.$length)?($throwRuntimeError("index out of range"),undefined):cw.$array[cw.$offset+cx]);if(-1===cy.BattleAttr.BulletLocalId){$s=8;continue;}cz=((ae<0||ae>=af.$length)?($throwRuntimeError("index out of range"),undefined):af.$array[af.$offset+ae]);BH(cy.BlState,cy.FramesInBlState+1>>0,cy.VirtualGridX,cy.VirtualGridY,cy.DirX,cy.DirY,cy.VelX,cy.VelY,cy.Speed,cy.BattleAttr.BulletLocalId,cy.BattleAttr.OriginatedRenderFrameId,cy.BattleAttr.OffenderJoinIndex,cy.BattleAttr.TeamId,cy.Bullet,cz);if(AM(cz,p)){$s=9;continue;}$s=10;continue;case 9:if(AL(cz,p)){$s=11;continue;}$s=12;continue;case 11:da=AP(cz.VirtualGridX,cz.VirtualGridY);db=da[0];dc=da[1];dd=AP(cz.Bullet.HitboxSizeX,cz.Bullet.HitboxSizeY);de=dd[0];df=dd[1];dg=((bm<0||bm>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+bm]);BA(dg,db,dc,de,df,0.1,0.1,0.1,0.1,e,f,cz,"FireballBullet");bm=bm+(1)>>0;$r=c.AddSingle(dg);$s=14;case 14:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}cz.BlState=1;if(!((cz.BlState===cy.BlState))){cz.FramesInBlState=0;}dh=cz.VirtualGridX+cz.VelX>>0;di=cz.VirtualGridY+cz.VelY>>0;cz.VirtualGridX=dh;cz.VirtualGridY=di;$s=13;continue;case 12:dl=(dj=p.PlayersArr,dk=cz.BattleAttr.OffenderJoinIndex-1>>0,((dk<0||dk>=dj.$length)?($throwRuntimeError("index out of range"),undefined):dj.$array[dj.$offset+dk]));dm=(dn=U[$Int32.keyFor(dl.CharacterState)],dn!==undefined?[dn.v,true]:[false,false]);dp=dm[1];if(dp){cx++;$s=7;continue;}case 13:ae=ae+(1)>>0;case 10:cx++;$s=7;continue;case 8:((ae<0||ae>=af.$length)?($throwRuntimeError("index out of range"),undefined):af.$array[af.$offset+ae]).BattleAttr.BulletLocalId=-1;dq=p.MeleeBullets;dr=0;case 15:if(!(dr=dq.$length)?($throwRuntimeError("index out of range"),undefined):dq.$array[dq.$offset+dr]);if(-1===ds.BattleAttr.BulletLocalId){$s=16;continue;}dt=((ac<0||ac>=ad.$length)?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+ac]);BG(ds.BlState,ds.FramesInBlState+1>>0,ds.BattleAttr.BulletLocalId,ds.BattleAttr.OriginatedRenderFrameId,ds.BattleAttr.OffenderJoinIndex,ds.BattleAttr.TeamId,ds.Bullet,dt);if(AK(dt,p)){$s=17;continue;}$s=18;continue;case 17:dw=(du=p.PlayersArr,dv=dt.BattleAttr.OffenderJoinIndex-1>>0,((dv<0||dv>=du.$length)?($throwRuntimeError("index out of range"),undefined):du.$array[du.$offset+dv]));dx=(dy=U[$Int32.keyFor(dw.CharacterState)],dy!==undefined?[dy.v,true]:[false,false]);dz=dx[1];if(dz){dr++;$s=15;continue;}if(AJ(dt,p)){$s=19;continue;}$s=20;continue;case 19:ea=1;if(0>dw.DirX){ea=-ea;}eb=AP(dw.VirtualGridX+($imul(ea,dt.Bullet.HitboxOffsetX))>>0,dw.VirtualGridY);ec=eb[0];ed=eb[1];ee=AP(dt.Bullet.HitboxSizeX,dt.Bullet.HitboxSizeY);ef=ee[0];eg=ee[1];eh=((bm<0||bm>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+bm]);BA(eh,ec,ed,ef,eg,0.1,0.1,0.1,0.1,e,f,dt,"MeleeBullet");bm=bm+(1)>>0;$r=c.AddSingle(eh);$s=21;case 21:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}dt.BlState=1;if(!((dt.BlState===ds.BlState))){dt.FramesInBlState=0;}case 20:ac=ac+(1)>>0;case 18:dr++;$s=15;continue;case 16:((ac<0||ac>=ad.$length)?($throwRuntimeError("index out of range"),undefined):ad.$array[ad.$offset+ac]).BattleAttr.BulletLocalId=-1;ei=p.PlayersArr;ej=0;case 22:if(!(ej=ei.$length)?($throwRuntimeError("index out of range"),undefined):ei.$array[ei.$offset+ej]);em=el.JoinIndex;en=((ek<0||ek>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+ek]);eo=$assertType(en.Shape,BW);ep=((ek<0||ek>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+ek]);es=AU(em,el,ep,en,eo,0.1,(eq=em-1>>0,((eq<0||eq>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+eq])),(er=em-1>>0,((er<0||er>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+er])),i);$s=24;case 24:if($c){$c=false;es=es.$blk();}if(es&&es.$blk!==undefined){break s;}et=es;eu=((ek<0||ek>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+ek]);ev=false;ew=en.CheckAllWithHolder(0,0,i);if(ew){$s=25;continue;}$s=26;continue;case 25:case 27:ex=i.PopFirstCollidedObject();if(BT.nil===ex){$s=28;continue;}ey=false;ez=false;fa=false;fb=ey;fc=ez;fd=fa;fe=ex.Data;if($assertType(fe,BU,true)[1]){ff=fe.$val;if(18===ff.CharacterState){$s=27;continue;}fc=true;}else if($assertType(fe,BR,true)[1]||$assertType(fe,BV,true)[1]){fg=fe;fd=true;}else{fh=fe;fb=true;}if(fd){$s=27;continue;}fi=$assertType(ex.Shape,BW);fk=AG(0,0,eo,fi);$s=29;case 29:if($c){$c=false;fk=fk.$blk();}if(fk&&fk.$blk!==undefined){break s;}fj=fk;fl=fj[0];fm=fj[1];fn=fj[2];fo=fj[3];if(!fl){$s=27;continue;}fp=fo.OverlapX*0+fo.OverlapY*-1;if(fc){fq=(fo.Overlap-0.2)*fo.OverlapX;fr=(fo.Overlap-0.2)*fo.OverlapY;fm=fq;fn=fr;}fs=0;while(true){if(!(fs>0,((fu<0||fu>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+fu])),((fs<0||fs>=ft.$length)?($throwRuntimeError("index out of range"),undefined):ft.$array[ft.$offset+fs]));fw=fm*fv.X+fn*fv.Y;if(fb||(fc&&0>fw)){fm=fm-(fw*fv.X);fn=fn-(fw*fv.Y);}fs=fs+(1)>>0;}fx=em-1>>0;((fx<0||fx>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fx]).X=((fx<0||fx>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fx]).X+(fm);fy=em-1>>0;((fy<0||fy>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fy]).Y=((fy<0||fy>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+fy]).Y+(fn);if(0.5=el.VelY;if(fz){ep.VelY=0;ep.VelX=0;if(18===ep.CharacterState){}else if(8===ep.CharacterState){ep.CharacterState=9;ep.FramesToRecover=eu.LayDownFramesToRecover;}else{ga=el.CharacterState;if((ga===(8))||(ga===(4))||(ga===(5))||(ga===(16))){gb=0;gc=el.ColliderRadius;gd=gb;ge=gc;gf=AP(gd,ge);gg=gf[1];gh=em-1>>0;((gh<0||gh>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+gh]).Y=((gh<0||gh>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+gh]).Y-(gg);}ep.CharacterState=0;ep.FramesToRecover=0;}}else{gi=(gj=W[$Int32.keyFor(ep.CharacterState)],gj!==undefined?[gj.v,true]:[false,false]);gk=gi[1];if(gk){if(18===ep.CharacterState){ep.VelY=0;ep.VelX=0;}else if(9===ep.CharacterState){if(0===ep.FramesToRecover){ep.CharacterState=10;ep.FramesToRecover=eu.GetUpFramesToRecover;}}else if(10===ep.CharacterState){if(0===ep.FramesToRecover){ep.CharacterState=0;ep.FramesInvinsible=eu.GetUpInvinsibleFrames;}}}}}if(eu.OnWallEnabled){if(ep.InAir){gl=(gm=U[$Int32.keyFor(el.CharacterState)],gm!==undefined?[gm.v,true]:[false,false]);gn=gl[1];if(!gn){go=0;while(true){if(!(go>0,((gq<0||gq>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+gq])),((go<0||go>=gp.$length)?($throwRuntimeError("index out of range"),undefined):gp.$array[gp.$offset+go]));gs=gr.X*1+gr.Y*0;gt=gr.X*-1+gr.Y*0;if(0.9>0));gv=((gr.Y>>0));ep.OnWallNormX=gu;ep.OnWallNormY=gv;break;}if(0.9>0));gx=((gr.Y>>0));ep.OnWallNormX=gw;ep.OnWallNormY=gx;break;}go=go+(1)>>0;}}}if(!ep.OnWall){gy=0;gz=0;ep.OnWallNormX=gy;ep.OnWallNormY=gz;}}ej++;$s=22;continue;case 23:ha=u.$length;case 30:if(!(ha=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+ha]);hc=hb.CheckAllWithHolder(0,0,i);if(!hc){ha=ha+(1)>>0;$s=30;continue;}hd=false;he=false;hf=BP.nil;hg=BO.nil;hh=hb.Data;if($assertType(hh,BR,true)[1]){hi=hh.$val;hf=hi.Bullet;hg=hi.BattleAttr;}else if($assertType(hh,BV,true)[1]){hj=hh.$val;hf=hj.Bullet;hg=hj.BattleAttr;}hk=$assertType(hb.Shape,BW);hn=(hl=p.PlayersArr,hm=hg.OffenderJoinIndex-1>>0,((hm<0||hm>=hl.$length)?($throwRuntimeError("index out of range"),undefined):hl.$array[hl.$offset+hm]));case 32:ho=i.PopFirstCollidedObject();if(BT.nil===ho){$s=33;continue;}hp=$assertType(ho.Shape,BW);hq=ho.Data;if($assertType(hq,BU,true)[1]){$s=34;continue;}$s=35;continue;case 34:hr=hq.$val;if(hg.OffenderJoinIndex===hr.JoinIndex){$s=32;continue;}hu=AG(0,0,hk,hp);$s=37;case 37:if($c){$c=false;hu=hu.$blk();}if(hu&&hu.$blk!==undefined){break s;}ht=hu;hv=ht[0];if(!hv){$s=32;continue;}hw=(hx=V[$Int32.keyFor(hr.CharacterState)],hx!==undefined?[hx.v,true]:[false,false]);hy=hw[1];if(hy){$s=32;continue;}if(0hn.DirX){hz=-hz;}ib=(ia=hr.JoinIndex-1>>0,((ia<0||ia>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+ia]));ib.Hp=ib.Hp-(hf.Damage)>>0;ic=$imul(hz,hf.PushbackVelX);id=hf.PushbackVelY;ie=ic;ig=id;ib.VelX=ie;ib.VelY=ig;if(0>=ib.Hp){ib.Hp=0;ib.CharacterState=18;ib.FramesToRecover=60;}else{if(hf.BlowUp){ib.CharacterState=8;}else{ib.CharacterState=3;}ii=(ih=hr.JoinIndex-1>>0,((ih<0||ih>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+ih])).FramesToRecover;if(hf.HitStunFrames>ii){ib.FramesToRecover=hf.HitStunFrames;}}$s=36;continue;case 35:hs=hq;hd=true;case 36:$s=32;continue;case 33:if(hd){ij=hb.Data;if($assertType(ij,BR,true)[1]){ik=ij.$val;ik.BlState=2;if(he){ik.FramesInBlState=0;}else{ik.FramesInBlState=ik.Bullet.ExplosionFrames+1>>0;}}else if($assertType(ij,BV,true)[1]){il=ij.$val;il.BlState=2;il.FramesInBlState=0;}}ha=ha+(1)>>0;$s=30;continue;case 31:im=p.PlayersArr;io=0;while(true){if(!(io=im.$length)?($throwRuntimeError("index out of range"),undefined):im.$array[im.$offset+io]);ir=iq.JoinIndex;is=((ip<0||ip>=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+ip]);it=((ip<0||ip>=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+ip]);iu=AS(is.X-(iv=ir-1>>0,((iv<0||iv>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+iv])).X,is.Y-(iw=ir-1>>0,((iw<0||iw>=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+iw])).Y,is.W*0.5,is.H*0.5,0,0,0,0,e,f);it.VirtualGridX=iu[0];it.VirtualGridY=iu[1];if(it.InAir){ix=it.CharacterState;iy=ix;if((iy===(0))||(iy===(1))||(iy===(17))){if(((ip<0||ip>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+ip])||(5===iq.CharacterState)){it.CharacterState=5;}else{it.CharacterState=4;}}else if(iy===(2)){it.CharacterState=6;}else if(iy===(3)){it.CharacterState=7;}}if(it.OnWall){iz=it.CharacterState;if((iz===(1))||(iz===(5))||(iz===(4))){ja=(16===iq.CharacterState);jb=iq.OnWall&&12<=it.FramesInChState;if(ja||jb){it.CharacterState=16;}}}if(!((it.CharacterState===iq.CharacterState))){it.FramesInChState=0;}jc=(jd=W[$Int32.keyFor(it.CharacterState)],jd!==undefined?[jd.v,true]:[false,false]);je=jc[1];if(je){it.ActiveSkillId=-1;it.ActiveSkillHit=-1;}io++;}jf=0;while(true){if(!(jf=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+jf]);jg.Space.RemoveSingle(jg);jf=jf+(1)>>0;}s.Id=q;s.BulletLocalIdCounter=ag;$s=-1;return true;}return;}var $f={$blk:AX,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az,b,ba,bb,bc,bd,be,bf,bg,bh,bi,bj,bk,bl,bm,bn,bo,bp,bq,br,bs,bt,bu,bv,bw,bx,by,bz,c,ca,cb,cc,cd,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,cu,cv,cw,cx,cy,cz,d,da,db,dc,dd,de,df,dg,dh,di,dj,dk,dl,dm,dn,dp,dq,dr,ds,dt,du,dv,dw,dx,dy,dz,e,ea,eb,ec,ed,ee,ef,eg,eh,ei,ej,ek,el,em,en,eo,ep,eq,er,es,et,eu,ev,ew,ex,ey,ez,f,fa,fb,fc,fd,fe,ff,fg,fh,fi,fj,fk,fl,fm,fn,fo,fp,fq,fr,fs,ft,fu,fv,fw,fx,fy,fz,g,ga,gb,gc,gd,ge,gf,gg,gh,gi,gj,gk,gl,gm,gn,go,gp,gq,gr,gs,gt,gu,gv,gw,gx,gy,gz,h,ha,hb,hc,hd,he,hf,hg,hh,hi,hj,hk,hl,hm,hn,ho,hp,hq,hr,hs,ht,hu,hv,hw,hx,hy,hz,i,ia,ib,ic,id,ie,ig,ih,ii,ij,ik,il,im,io,ip,iq,ir,is,it,iu,iv,iw,ix,iy,iz,j,ja,jb,jc,jd,je,jf,jg,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=AX;AY=function(a,b,c,d,e,f,g,h,i,j,k,l){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l});$s=$s||0;s:while(true){switch($s){case 0:m=AQ(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=AZ(n,o,g+c+h,f+d+e,k,l);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:AY,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.GenerateRectCollider=AY;AZ=function(a,b,c,d,e,f){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e,f});$s=$s||0;s:while(true){switch($s){case 0:g=B.NewObjectSingleTag(a,b,c,d,f);h=B.NewRectangle(0,0,c,d);$r=g.SetShape(h);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g.Data=e;$s=-1;return g;}return;}var $f={$blk:AZ,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};BA=function(a,b,c,d,e,f,g,h,i,j,k,l,m){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;n=AQ(b,c,d*0.5,e*0.5,f,g,h,i,j,k);o=n[0];p=n[1];q=h+d+i;r=g+e+f;s=q;t=r;u=o;v=p;w=s;x=t;a.X=u;a.Y=v;a.W=w;a.H=x;y=$assertType(a.Shape,BW);y.UpdateAsRectangle(0,0,s,t);a.Data=l;};$pkg.UpdateRectCollider=BA;BB=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=BC(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(CA.nil);l=f.Points;m=0;while(true){if(!(m=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+m]);p=f.Points;q=0;while(true){if(!(q=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(n===r){q++;continue;}if(A.Abs(s.X-o.X)>i){i=A.Abs(s.X-o.X);}if(A.Abs(s.Y-o.Y)>j){j=A.Abs(s.Y-o.Y);}q++;}m++;}t=0;while(true){if(!(t=u.$length)?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+t]));k.AddPoints(new CA([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new CB([e]));$r=w.SetShape(k);$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w.Data=d;$s=-1;return w;}return;}var $f={$blk:BB,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,$s};return $f;};$pkg.GenerateConvexPolygonCollider=BB;BC=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new C.ptr(1.7e+308,1.7e+308);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.X=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]);(k=f.Points,((i<0||i>=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+i]=new C.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=BC;BD=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return new K.ptr(u,v,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,w,x,false));};$pkg.NewMeleeBullet=BD;BE=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return new L.ptr(u,v,w,x,y,z,aa,ab,ac,new J.ptr(a,b,c,t),new I.ptr(d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,ad,ae,false));};$pkg.NewFireballBullet=BE;BF=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return new E.ptr(a,b,c,d,e,f,g,m,n,p,s,false,0,0,h,i,q,r,o,t,u,v,w,x,j,k,l,y,z,aa,ab);};$pkg.NewPlayerDownsync=BF;BG=function(a,b,c,d,e,f,g,h){var a,b,c,d,e,f,g,h;h.BlState=a;h.FramesInBlState=b;h.BattleAttr.BulletLocalId=c;h.BattleAttr.OriginatedRenderFrameId=d;h.BattleAttr.OffenderJoinIndex=e;h.BattleAttr.TeamId=f;h.Bullet=g;};$pkg.CloneMeleeBullet=BG;BH=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;o.BlState=a;o.FramesInBlState=b;o.VirtualGridX=c;o.VirtualGridY=d;o.DirX=e;o.DirY=f;o.VelX=g;o.VelY=h;o.Speed=i;o.BattleAttr.BulletLocalId=j;o.BattleAttr.OriginatedRenderFrameId=k;o.BattleAttr.OffenderJoinIndex=l;o.BattleAttr.TeamId=m;o.Bullet=n;};$pkg.CloneFireballBullet=BH;BI=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac){var a,aa,ab,ac,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;ac.Id=a;ac.VirtualGridX=b;ac.VirtualGridY=c;ac.DirX=d;ac.DirY=e;ac.VelX=f;ac.VelY=g;ac.FramesToRecover=h;ac.FramesInChState=i;ac.ActiveSkillId=j;ac.ActiveSkillHit=k;ac.FramesInvinsible=l;ac.Speed=m;ac.BattleState=n;ac.CharacterState=o;ac.JoinIndex=p;ac.Hp=q;ac.MaxHp=r;ac.ColliderRadius=s;ac.InAir=t;ac.OnWall=u;ac.OnWallNormX=v;ac.OnWallNormY=w;ac.CapturedByInertia=x;ac.BulletTeamId=y;ac.ChCollisionTeamId=z;ac.RevivalVirtualGridX=aa;ac.RevivalVirtualGridY=ab;};$pkg.ClonePlayerDownsync=BI;BJ=function(a,b,c,d,e,f){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;f.Id=a;f.BulletLocalIdCounter=c;g=0;while(true){if(!(g=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+g]);if(BU.nil===h||(-1===h.Id)){break;}BI(h.Id,h.VirtualGridX,h.VirtualGridY,h.DirX,h.DirY,h.VelX,h.VelY,h.FramesToRecover,h.FramesInChState,h.ActiveSkillId,h.ActiveSkillHit,h.FramesInvinsible,h.Speed,h.BattleState,h.CharacterState,h.JoinIndex,h.Hp,h.MaxHp,h.ColliderRadius,h.InAir,h.OnWall,h.OnWallNormX,h.OnWallNormY,h.CapturedByInertia,h.BulletTeamId,h.ChCollisionTeamId,h.RevivalVirtualGridX,h.RevivalVirtualGridY,(i=f.PlayersArr,((g<0||g>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+g])));g=g+(1)>>0;}j=0;while(true){if(!(j=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+j]);if(BR.nil===k||(-1===k.BattleAttr.BulletLocalId)){break;}BG(k.BlState,k.FramesInBlState,k.BattleAttr.BulletLocalId,k.BattleAttr.OriginatedRenderFrameId,k.BattleAttr.OffenderJoinIndex,k.BattleAttr.TeamId,k.Bullet,(l=f.MeleeBullets,((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])));j=j+(1)>>0;}m=0;while(true){if(!(m=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+m]);if(BV.nil===n||(-1===n.BattleAttr.BulletLocalId)){break;}BH(n.BlState,n.FramesInBlState,n.VirtualGridX,n.VirtualGridY,n.DirX,n.DirY,n.VelX,n.VelY,n.Speed,n.BattleAttr.BulletLocalId,n.BattleAttr.OriginatedRenderFrameId,n.BattleAttr.OffenderJoinIndex,n.BattleAttr.TeamId,n.Bullet,(o=f.FireballBullets,((m<0||m>=o.$length)?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+m])));m=m+(1)>>0;}};$pkg.CloneRoomDownsyncFrame=BJ;BK=function(a,b,c){var a,b,c,d,e,f,g,h,i,j,k,l;d=$makeSlice(CE,a);e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]=f);e=e+(1)>>0;}g=$makeSlice(CF,b);h=0;while(true){if(!(h=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]=i);h=h+(1)>>0;}j=$makeSlice(CG,c);k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]=l);k=k+(1)>>0;}return new N.ptr(-1,d,new $Int64(0,0),g,j,new $Uint64(0,0),false,-1);};$pkg.NewPreallocatedRoomDownsyncFrame=BK;BU.methods=[{prop:"GetId",name:"GetId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetJoinIndex",name:"GetJoinIndex",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVirtualGridX",name:"GetVirtualGridX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVirtualGridY",name:"GetVirtualGridY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirX",name:"GetDirX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirY",name:"GetDirY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelX",name:"GetVelX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelY",name:"GetVelY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeed",name:"GetSpeed",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHp",name:"GetHp",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetMaxHp",name:"GetMaxHp",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetCharacterState",name:"GetCharacterState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesToRecover",name:"GetFramesToRecover",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesInChState",name:"GetFramesInChState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetInAir",name:"GetInAir",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"GetOnWall",name:"GetOnWall",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"GetOnWallNormX",name:"GetOnWallNormX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetColliderRadius",name:"GetColliderRadius",pkg:"",typ:$funcType([],[$Int32],false)}];BR.methods=[{prop:"GetBlState",name:"GetBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesInBlState",name:"GetFramesInBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetBulletLocalId",name:"GetBulletLocalId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOffenderJoinIndex",name:"GetOffenderJoinIndex",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOriginatedRenderFrameId",name:"GetOriginatedRenderFrameId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetStartupFrames",name:"GetStartupFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetActiveFrames",name:"GetActiveFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeX",name:"GetHitboxSizeX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeY",name:"GetHitboxSizeY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetX",name:"GetHitboxOffsetX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetY",name:"GetHitboxOffsetY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetExplosionFrames",name:"GetExplosionFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeciesId",name:"GetSpeciesId",pkg:"",typ:$funcType([],[$Int32],false)}];BV.methods=[{prop:"GetVirtualGridX",name:"GetVirtualGridX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVirtualGridY",name:"GetVirtualGridY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirX",name:"GetDirX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetDirY",name:"GetDirY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelX",name:"GetVelX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetVelY",name:"GetVelY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeed",name:"GetSpeed",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetBlState",name:"GetBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetFramesInBlState",name:"GetFramesInBlState",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetBulletLocalId",name:"GetBulletLocalId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOffenderJoinIndex",name:"GetOffenderJoinIndex",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetOriginatedRenderFrameId",name:"GetOriginatedRenderFrameId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetStartupFrames",name:"GetStartupFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetActiveFrames",name:"GetActiveFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeX",name:"GetHitboxSizeX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxSizeY",name:"GetHitboxSizeY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetX",name:"GetHitboxOffsetX",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetHitboxOffsetY",name:"GetHitboxOffsetY",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetExplosionFrames",name:"GetExplosionFrames",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeciesId",name:"GetSpeciesId",pkg:"",typ:$funcType([],[$Int32],false)}];BZ.methods=[{prop:"GetId",name:"GetId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetCountdownNanos",name:"GetCountdownNanos",pkg:"",typ:$funcType([],[$Int64],false)},{prop:"GetBackendUnconfirmedMask",name:"GetBackendUnconfirmedMask",pkg:"",typ:$funcType([],[$Uint64],false)},{prop:"GetBulletLocalIdCounter",name:"GetBulletLocalIdCounter",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetShouldForceResync",name:"GetShouldForceResync",pkg:"",typ:$funcType([],[$Bool],false)},{prop:"GetPlayersArr",name:"GetPlayersArr",pkg:"",typ:$funcType([],[CE],false)},{prop:"GetMeleeBullets",name:"GetMeleeBullets",pkg:"",typ:$funcType([],[CF],false)},{prop:"GetFireballBullets",name:"GetFireballBullets",pkg:"",typ:$funcType([],[CG],false)}];BX.methods=[{prop:"GetInputFrameId",name:"GetInputFrameId",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetInputList",name:"GetInputList",pkg:"",typ:$funcType([],[BY],false)},{prop:"GetConfirmedList",name:"GetConfirmedList",pkg:"",typ:$funcType([],[$Uint64],false)}];CJ.methods=[{prop:"GetSpeed",name:"GetSpeed",pkg:"",typ:$funcType([],[$Int32],false)},{prop:"GetSpeciesId",name:"GetSpeciesId",pkg:"",typ:$funcType([],[$Int],false)},{prop:"GetSpeciesName",name:"GetSpeciesName",pkg:"",typ:$funcType([],[$String],false)}];C.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);D.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:CC,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:CD,tag:""}]);E.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleState",name:"BattleState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JoinIndex",name:"JoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ColliderRadius",name:"ColliderRadius",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Removed",name:"Removed",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Score",name:"Score",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LastMoveGmtMillis",name:"LastMoveGmtMillis",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesToRecover",name:"FramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInChState",name:"FramesInChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hp",name:"Hp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"MaxHp",name:"MaxHp",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CharacterState",name:"CharacterState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InAir",name:"InAir",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWall",name:"OnWall",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallNormX",name:"OnWallNormX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OnWallNormY",name:"OnWallNormY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CapturedByInertia",name:"CapturedByInertia",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"ActiveSkillId",name:"ActiveSkillId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveSkillHit",name:"ActiveSkillHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInvinsible",name:"FramesInvinsible",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BulletTeamId",name:"BulletTeamId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ChCollisionTeamId",name:"ChCollisionTeamId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RevivalVirtualGridX",name:"RevivalVirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RevivalVirtualGridY",name:"RevivalVirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""}]);F.init("",[{prop:"Dx",name:"Dx",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Dy",name:"Dy",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnALevel",name:"BtnALevel",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BtnBLevel",name:"BtnBLevel",embedded:false,exported:true,typ:$Int32,tag:""}]);H.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:CH,tag:""}]);I.init("",[{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableStFrame",name:"CancellableStFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancellableEdFrame",name:"CancellableEdFrame",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitStunFrames",name:"HitStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlockStunFrames",name:"BlockStunFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelX",name:"PushbackVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PushbackVelY",name:"PushbackVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelX",name:"SelfLockVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SelfLockVelY",name:"SelfLockVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetX",name:"HitboxOffsetX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxOffsetY",name:"HitboxOffsetY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeX",name:"HitboxSizeX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"HitboxSizeY",name:"HitboxSizeY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlowUp",name:"BlowUp",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"ExplosionFrames",name:"ExplosionFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"CancelTransit",name:"CancelTransit",embedded:false,exported:true,typ:CI,tag:""}]);J.init("",[{prop:"BulletLocalId",name:"BulletLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"TeamId",name:"TeamId",embedded:false,exported:true,typ:$Int32,tag:""}]);K.init("",[{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BO,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BP,tag:""}]);L.init("",[{prop:"VirtualGridX",name:"VirtualGridX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VirtualGridY",name:"VirtualGridY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirX",name:"DirX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DirY",name:"DirY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelX",name:"VelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"VelY",name:"VelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BlState",name:"BlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"FramesInBlState",name:"FramesInBlState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BattleAttr",name:"BattleAttr",embedded:false,exported:true,typ:BO,tag:""},{prop:"Bullet",name:"Bullet",embedded:false,exported:true,typ:BP,tag:""}]);M.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFrames",name:"RecoveryFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnBlock",name:"RecoveryFramesOnBlock",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"RecoveryFramesOnHit",name:"RecoveryFramesOnHit",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"BoundChState",name:"BoundChState",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Hits",name:"Hits",embedded:false,exported:true,typ:BN,tag:""}]);N.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:CE,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:CF,tag:""},{prop:"FireballBullets",name:"FireballBullets",embedded:false,exported:true,typ:CG,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BulletLocalIdCounter",name:"BulletLocalIdCounter",embedded:false,exported:true,typ:$Int32,tag:""}]);O.init("",[{prop:"InputFrameId",name:"InputFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InputList",name:"InputList",embedded:false,exported:true,typ:BY,tag:""},{prop:"ConfirmedList",name:"ConfirmedList",embedded:false,exported:true,typ:$Uint64,tag:""}]);P.init("",[{prop:"FlAct",name:"FlAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"FrAct",name:"FrAct",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);Q.init([$Int,BU],[$Int],false);R.init("",[{prop:"SpeciesId",name:"SpeciesId",embedded:false,exported:true,typ:$Int,tag:""},{prop:"SpeciesName",name:"SpeciesName",embedded:false,exported:true,typ:$String,tag:""},{prop:"InAirIdleFrameIdxTurningPoint",name:"InAirIdleFrameIdxTurningPoint",embedded:false,exported:true,typ:$Int,tag:""},{prop:"InAirIdleFrameIdxTurnedCycle",name:"InAirIdleFrameIdxTurnedCycle",embedded:false,exported:true,typ:$Int,tag:""},{prop:"LayDownFrames",name:"LayDownFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"LayDownFramesToRecover",name:"LayDownFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpInvinsibleFrames",name:"GetUpInvinsibleFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"GetUpFramesToRecover",name:"GetUpFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Speed",name:"Speed",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JumpingInitVelY",name:"JumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"JumpingFramesToRecover",name:"JumpingFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"DashingEnabled",name:"DashingEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"OnWallEnabled",name:"OnWallEnabled",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"WallJumpingFramesToRecover",name:"WallJumpingFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelX",name:"WallJumpingInitVelX",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallJumpingInitVelY",name:"WallJumpingInitVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"WallSlidingVelY",name:"WallSlidingVelY",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InertiaFramesToRecover",name:"InertiaFramesToRecover",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"SkillMapper",name:"SkillMapper",embedded:false,exported:true,typ:Q,tag:""}]);AF.init("",[{prop:"Overlap",name:"Overlap",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapX",name:"OverlapX",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"OverlapY",name:"OverlapY",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"AContainedInB",name:"AContainedInB",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"BContainedInA",name:"BContainedInA",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Axis",name:"Axis",embedded:false,exported:true,typ:B.Vector,tag:""}]);$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new BM([new BL([0,0]),new BL([0,2]),new BL([0,-2]),new BL([2,0]),new BL([-2,0]),new BL([1,1]),new BL([-1,-1]),new BL([1,-1]),new BL([-1,1])]);S=$makeMap($Int.keyFor,[{k:1,v:new M.ptr(0,30,30,30,1,2,new BN([new K.ptr(0,0,BO.nil,new I.ptr(7,13,30,22,13,9,5,0,5,1,-1,120,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:2}])))]))},{k:2,v:new M.ptr(0,36,36,36,1,11,new BN([new K.ptr(0,0,BO.nil,new I.ptr(18,22,36,18,18,9,5,0,5,1,-1,180,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:3}])))]))},{k:3,v:new M.ptr(0,50,50,50,1,12,new BN([new K.ptr(0,0,BO.nil,new I.ptr(8,0,0,30,999999999,9,20,70,10,5,50,160,80,320,320,true,9,1,false))]))},{k:4,v:new M.ptr(0,30,30,30,1,2,new BN([new K.ptr(0,0,BO.nil,new I.ptr(7,13,30,22,13,9,5,0,5,1,-1,120,0,240,320,false,15,2,$makeMap($Int.keyFor,[{k:1,v:5}])))]))},{k:5,v:new M.ptr(0,36,36,36,1,11,new BN([new K.ptr(0,0,BO.nil,new I.ptr(18,23,36,18,18,9,5,0,5,1,-1,180,0,240,320,false,15,2,$makeMap($Int.keyFor,[{k:1,v:6}])))]))},{k:6,v:new M.ptr(0,45,45,45,1,12,new BN([new K.ptr(0,0,BO.nil,new I.ptr(8,0,0,28,999999999,9,20,30,10,-1,-1,240,0,320,320,true,15,2,false))]))},{k:7,v:new M.ptr(0,30,30,30,1,2,new BN([new K.ptr(0,0,BO.nil,new I.ptr(7,13,30,22,13,9,5,0,5,-1,-1,120,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:8}])))]))},{k:8,v:new M.ptr(0,36,36,36,1,11,new BN([new K.ptr(0,0,BO.nil,new I.ptr(18,22,36,18,18,9,5,0,5,1,-1,180,0,240,320,false,9,1,$makeMap($Int.keyFor,[{k:1,v:9}])))]))},{k:9,v:new M.ptr(0,40,40,40,1,12,new BN([new K.ptr(0,0,BO.nil,new I.ptr(7,0,0,30,999999999,9,20,40,10,10,-1,100,0,320,320,true,9,1,false))]))},{k:10,v:new M.ptr(0,38,38,38,1,13,new BN([new L.ptr(0,0,0,0,0,0,60,0,0,BO.nil,new I.ptr(10,0,0,999999999,15,9,20,0,22,-1,-1,320,100,640,480,false,30,1,false))]))},{k:11,v:new M.ptr(0,60,60,60,1,14,new BN([new K.ptr(0,0,BO.nil,new I.ptr(3,0,0,25,999999999,9,20,70,35,10,80,80,0,400,640,true,15,3,false))]))},{k:12,v:new M.ptr(0,10,10,10,1,15,new BN([new K.ptr(0,0,BO.nil,new I.ptr(3,0,0,0,0,0,-1,-1,0,60,0,0,0,0,0,false,0,0,false))]))},{k:13,v:new M.ptr(0,12,12,12,1,15,new BN([new K.ptr(0,0,BO.nil,new I.ptr(3,0,0,0,0,0,-1,-1,0,80,0,0,0,0,0,false,0,0,false))]))},{k:14,v:new M.ptr(0,8,8,8,1,15,new BN([new K.ptr(0,0,BO.nil,new I.ptr(4,0,0,0,999999999,0,-1,-1,0,50,0,0,0,0,0,false,0,0,false))]))},{k:15,v:new M.ptr(0,48,48,48,1,13,new BN([new L.ptr(0,0,0,0,0,0,40,0,0,BO.nil,new I.ptr(12,0,0,999999999,15,9,30,0,18,-1,-1,240,80,480,320,false,30,2,false))]))},{k:16,v:new M.ptr(0,60,60,60,1,13,new BN([new L.ptr(0,0,0,0,0,0,40,0,0,BO.nil,new I.ptr(16,0,0,999999999,999999999,9,30,70,30,-1,-1,240,80,480,320,true,30,3,false))]))},{k:255,v:new M.ptr(0,30,30,30,1,6,new BN([new K.ptr(0,0,BO.nil,new I.ptr(3,0,0,20,18,9,5,0,5,-1,-1,120,0,320,240,false,9,1,false))]))},{k:256,v:new M.ptr(0,20,20,20,1,6,new BN([new K.ptr(0,0,BO.nil,new I.ptr(3,0,0,10,15,9,5,0,5,-1,-1,120,0,320,240,false,15,2,false))]))},{k:257,v:new M.ptr(0,30,30,30,1,6,new BN([new K.ptr(0,0,BO.nil,new I.ptr(4,0,0,20,9,5,5,0,5,-1,-1,120,0,320,240,false,9,1,false))]))}]);$pkg.Characters=$makeMap($Int.keyFor,[{k:0,v:new R.ptr(0,"MonkGirl",11,1,16,16,10,27,21,80,2,true,true,8,28,70,-10,9,(function(a,b){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(1===a){if(0===b.FramesToRecover){if(b.InAir){return 255;}else{return 1;}}else{c=(d=S[$Int.keyFor(((b.ActiveSkillId>>0)))],d!==undefined?[d.v,true]:[BQ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BR,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BQ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BR,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState>0)))],d!==undefined?[d.v,true]:[BQ.nil,false]);e=c[0];f=c[1];if(f){g=(h=e.Hits,i=b.ActiveSkillHit,((i<0||i>=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]));if($assertType(g,BR,true)[1]){j=g.$val;if(j.Bullet.CancellableStFrame<=b.FramesInChState&&b.FramesInChState=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]=e);c=c+(1)>>0;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:D,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewDynamicRectangleColliders=D;E=function(){return A.MakeWrapper(C.NewCollision());};$pkg.NewCollisionHolder=E;F=function(a,b,c){var a,b,c;return A.MakeWrapper(new B.InputFrameDownsync.ptr(a,b,c));};$pkg.NewInputFrameDownsync=F;G=function(a){var a;return A.MakeWrapper(C.NewRingBuffer(a));};$pkg.NewRingBufferJs=G;H=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(C.NewSpace(a,b,c,d));};$pkg.NewCollisionSpaceJs=H;I=function(a,b){var a,b;return A.MakeWrapper(new B.Vec2D.ptr(a,b));};$pkg.NewVec2DJs=I;J=function(a,b){var a,b;return A.MakeWrapper(new B.Polygon2D.ptr(a,b));};$pkg.NewPolygon2DJs=J;K=function(a){var a;return A.MakeWrapper(new B.Barrier.ptr(a));};$pkg.NewBarrierJs=K;L=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab){var a,aa,ab,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return A.MakeWrapper(B.NewPlayerDownsync(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab));};$pkg.NewPlayerDownsyncJs=L;M=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return A.MakeWrapper(B.NewMeleeBullet(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x));};$pkg.NewMeleeBulletJs=M;N=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae){var a,aa,ab,ac,ad,ae,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;return A.MakeWrapper(B.NewFireballBullet(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,ab,ac,ad,ae));};$pkg.NewFireballBulletJs=N;O=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(new B.NpcPatrolCue.ptr(a,b,c,d));};$pkg.NewNpcPatrolCue=O;P=function(a,b,c,d,e){var a,b,c,d,e,f;f=B.NewPreallocatedRoomDownsyncFrame(b.$length,64,64);B.CloneRoomDownsyncFrame(a,b,c,d,e,f);return A.MakeWrapper(f);};$pkg.NewRoomDownsyncFrameJs=P;Q=function(a){var a,b,c,d,e,f,g;b=a.Objects();c=$makeSlice(AF,b.$length);d=b;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=A.MakeWrapper(g));e++;}return c;};$pkg.GetCollisionSpaceObjsJs=Q;R=function(a,b,c,d,e){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c,d,e});$s=$s||0;s:while(true){switch($s){case 0:f=B.GenerateConvexPolygonCollider(a,b,c,d,e);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=A.MakeWrapper(f);$s=2;case 2:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}h=g;$s=3;case 3:return h;}return;}var $f={$blk:R,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=R;S=function(a){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=$makeSlice(AF,a.$length,a.$length);c=a;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);h=A.MakeFullWrapper((g=B.Characters[$Int.keyFor(f)],g!==undefined?g.v:AK.nil));$s=3;case 3:if($c){$c=false;h=h.$blk();}if(h&&h.$blk!==undefined){break s;}((e<0||e>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e]=h);d++;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:S,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GetCharacterConfigsOrderedByJoinIndex=S;T=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o});$s=$s||0;s:while(true){switch($s){case 0:p=B.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o);$s=1;case 1:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}q=p;$s=2;case 2:return q;}return;}var $f={$blk:T,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=T;U=function(a,b){var a,b,c;c=a.GetByFrameId(b);if($interfaceIsEqual($ifaceNil,c)){return null;}return A.MakeWrapper($assertType(c,AL));};$pkg.GetRoomDownsyncFrame=U;V=function(a,b){var a,b,c;c=a.GetByFrameId(b);if($interfaceIsEqual($ifaceNil,c)){return null;}return A.MakeWrapper($assertType(c,AM));};$pkg.GetInputFrameDownsync=V;W=function(a,b){var a,b,c;return(c=a.InputList,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b]));};$pkg.GetInput=W;X=function(a,b){var a,b;a.InputFrameId=b;return true;};$pkg.SetInputFrameId=X;Y=function(a,b,c){var a,b,c,d;if(b>=a.InputList.$length){return false;}(d=a.InputList,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b]=c));return true;};$pkg.SetInput=Y;Z=function(a,b){var a,b;a.ConfirmedList=b;return true;};$pkg.SetConfirmedList=Z;AA=function(a,b){var a,b,c;return A.MakeWrapper((c=a.PlayersArr,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b])));};$pkg.GetPlayer=AA;AB=function(a,b){var a,b,c,d;if(-1===(c=a.MeleeBullets,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b])).GetBulletLocalId()){return null;}return A.MakeWrapper((d=a.MeleeBullets,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])));};$pkg.GetMeleeBullet=AB;AC=function(a,b){var a,b,c,d;if(-1===(c=a.FireballBullets,((b<0||b>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+b])).GetBulletLocalId()){return null;}return A.MakeWrapper((d=a.FireballBullets,((b<0||b>=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+b])));};$pkg.GetFireballBullet=AC;AD=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new AN(I)},{k:"NewPolygon2DJs",v:new AO(J)},{k:"NewBarrierJs",v:new AP(K)},{k:"NewPlayerDownsyncJs",v:new AQ(L)},{k:"NewMeleeBulletJs",v:new AR(M)},{k:"NewFireballBulletJs",v:new AS(N)},{k:"NewNpcPatrolCue",v:new AT(O)},{k:"NewRoomDownsyncFrameJs",v:new BA(P)},{k:"NewCollisionSpaceJs",v:new BB(H)},{k:"NewCollisionHolder",v:new BC(E)},{k:"NewInputFrameDownsync",v:new BD(F)},{k:"NewRingBufferJs",v:new BE(G)},{k:"GenerateConvexPolygonColliderJs",v:new BF(R)},{k:"GetCollisionSpaceObjsJs",v:new BH(Q)},{k:"WorldToPolygonColliderBLPos",v:new BI(B.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new BI(B.PolygonColliderBLToWorldPos)},{k:"WorldToVirtualGridPos",v:new BJ(B.WorldToVirtualGridPos)},{k:"VirtualGridToWorldPos",v:new BK(B.VirtualGridToWorldPos)},{k:"GetCharacterConfigsOrderedByJoinIndex",v:new BM(S)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new BW(T)},{k:"ConvertToDelayedInputFrameId",v:new BX(B.ConvertToDelayedInputFrameId)},{k:"ConvertToNoDelayInputFrameId",v:new BX(B.ConvertToNoDelayInputFrameId)},{k:"ConvertToFirstUsedRenderFrameId",v:new BX(B.ConvertToFirstUsedRenderFrameId)},{k:"ConvertToLastUsedRenderFrameId",v:new BX(B.ConvertToLastUsedRenderFrameId)},{k:"ShouldGenerateInputFrameUpsync",v:new BY(B.ShouldGenerateInputFrameUpsync)},{k:"IsGeneralBulletActive",v:new BZ(B.IsGeneralBulletActive)},{k:"GetRoomDownsyncFrame",v:new CA(U)},{k:"GetInputFrameDownsync",v:new CA(V)},{k:"GetPlayer",v:new CB(AA)},{k:"GetMeleeBullet",v:new CB(AB)},{k:"GetFireballBullet",v:new CB(AC)},{k:"GetInput",v:new CC(W)},{k:"NewDynamicRectangleColliders",v:new CD(D)},{k:"SetInputFrameId",v:new CE(X)},{k:"SetInput",v:new CF(Y)},{k:"SetConfirmedList",v:new CG(Z)}]),CH);};$init=function(){$pkg.$init=function(){};var $f,$c=false,$s=0,$r;if(this!==undefined&&this.$blk!==undefined){$f=this;$c=true;$s=$f.$s;$r=$f.$r;}s:while(true){switch($s){case 0:$r=A.$init();$s=1;case 1:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($pkg===$mainPkg){AD();$mainFinished=true;}}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $synthesizeMethods(); $initAllLinknames(); var $mainPkg = $packages["jsexport"]; diff --git a/frontend/settings/project.json b/frontend/settings/project.json index 6b658ed..bbacb33 100644 --- a/frontend/settings/project.json +++ b/frontend/settings/project.json @@ -76,7 +76,7 @@ "shelter_z_reducer", "shelter" ], - "last-module-event-record-time": 1676513919950, + "last-module-event-record-time": 1677337364473, "simulator-orientation": false, "simulator-resolution": { "height": 640, diff --git a/jsexport/battle/battle.go b/jsexport/battle/battle.go index 02c168d..5cac574 100644 --- a/jsexport/battle/battle.go +++ b/jsexport/battle/battle.go @@ -490,7 +490,18 @@ func calcHardPushbacksNorms(joinIndex int32, currPlayerDownsync, thatPlayerInNex return retCnt } -func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync, currRenderFrame *RoomDownsyncFrame, chConfig *CharacterConfig, inputsBuffer *resolv.RingBuffer) (int, bool, int32, int32) { +func updateInputFrameInPlaceUponDynamics(inputFrameId int32, roomCapacity int, confirmedList uint64, inputList []uint64, lastIndividuallyConfirmedInputFrameId []int32, lastIndividuallyConfirmedInputList []uint64) { + for i := 0; i < roomCapacity; i++ { + if 0 == (confirmedList & (1 << uint32(i))) { + // This in-place update on the "inputsBuffer" is only correct when "delayed input for this player is not yet confirmed" + if lastIndividuallyConfirmedInputFrameId[i] < inputFrameId { + inputList[i] = lastIndividuallyConfirmedInputList[i] + } + } + } +} + +func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync, currRenderFrame *RoomDownsyncFrame, chConfig *CharacterConfig, inputsBuffer *resolv.RingBuffer, lastIndividuallyConfirmedInputFrameId []int32, lastIndividuallyConfirmedInputList []uint64) (int, bool, int32, int32) { // returns (patternId, jumpedOrNot, effectiveDx, effectiveDy) delayedInputFrameId := ConvertToDelayedInputFrameId(currRenderFrame.Id) delayedInputFrameIdForPrevRdf := ConvertToDelayedInputFrameId(currRenderFrame.Id - 1) @@ -503,10 +514,17 @@ func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync, return PATTERN_ID_UNABLE_TO_OP, false, 0, 0 } - delayedInputList := inputsBuffer.GetByFrameId(delayedInputFrameId).(*InputFrameDownsync).InputList + delayedInputFrameDownsync := inputsBuffer.GetByFrameId(delayedInputFrameId).(*InputFrameDownsync) + delayedInputList := delayedInputFrameDownsync.InputList + roomCapacity := len(delayedInputList) + updateInputFrameInPlaceUponDynamics(delayedInputFrameId, roomCapacity, delayedInputFrameDownsync.ConfirmedList, delayedInputList, lastIndividuallyConfirmedInputFrameId, lastIndividuallyConfirmedInputList) + var delayedInputListForPrevRdf []uint64 = nil if 0 < delayedInputFrameIdForPrevRdf { - delayedInputListForPrevRdf = inputsBuffer.GetByFrameId(delayedInputFrameIdForPrevRdf).(*InputFrameDownsync).InputList + delayedInputFrameDownsyncForPrevRdf := inputsBuffer.GetByFrameId(delayedInputFrameIdForPrevRdf).(*InputFrameDownsync) + delayedInputListForPrevRdf = delayedInputFrameDownsyncForPrevRdf.InputList + + updateInputFrameInPlaceUponDynamics(delayedInputFrameIdForPrevRdf, roomCapacity, delayedInputFrameDownsyncForPrevRdf.ConfirmedList, delayedInputListForPrevRdf, lastIndividuallyConfirmedInputFrameId, lastIndividuallyConfirmedInputList) } jumpedOrNot := false @@ -564,7 +582,7 @@ func deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame *PlayerDownsync, The function "ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame" is creating new heap-memory blocks at 60fps, e.g. nextRenderFramePlayers & nextRenderFrameMeleeBullets & nextRenderFrameFireballBullets & effPushbacks & hardPushbackNorms & jumpedOrNotList & dynamicRectangleColliders("player" & "bullet"), which would induce "possibly performance impacting garbage collections" when many rooms are running simultaneously. */ -func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer *resolv.RingBuffer, currRenderFrameId int32, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, collisionSpaceOffsetX, collisionSpaceOffsetY float64, chConfigsOrderedByJoinIndex []*CharacterConfig, renderFrameBuffer *resolv.RingBuffer, collision *resolv.Collision, effPushbacks []*Vec2D, hardPushbackNormsArr [][]*Vec2D, jumpedOrNotList []bool, dynamicRectangleColliders []*resolv.Object) bool { +func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer *resolv.RingBuffer, currRenderFrameId int32, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, collisionSpaceOffsetX, collisionSpaceOffsetY float64, chConfigsOrderedByJoinIndex []*CharacterConfig, renderFrameBuffer *resolv.RingBuffer, collision *resolv.Collision, effPushbacks []*Vec2D, hardPushbackNormsArr [][]*Vec2D, jumpedOrNotList []bool, dynamicRectangleColliders []*resolv.Object, lastIndividuallyConfirmedInputFrameId []int32, lastIndividuallyConfirmedInputList []uint64) bool { currRenderFrame := renderFrameBuffer.GetByFrameId(currRenderFrameId).(*RoomDownsyncFrame) nextRenderFrameId := currRenderFrameId + 1 roomCapacity := len(currRenderFrame.PlayersArr) @@ -613,7 +631,7 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer *resolv.Rin for i, currPlayerDownsync := range currRenderFrame.PlayersArr { chConfig := chConfigsOrderedByJoinIndex[i] thatPlayerInNextFrame := nextRenderFramePlayers[i] - patternId, jumpedOrNot, effDx, effDy := deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame, currRenderFrame, chConfig, inputsBuffer) + patternId, jumpedOrNot, effDx, effDy := deriveOpPattern(currPlayerDownsync, thatPlayerInNextFrame, currRenderFrame, chConfig, inputsBuffer, lastIndividuallyConfirmedInputFrameId, lastIndividuallyConfirmedInputList) jumpedOrNotList[i] = jumpedOrNot joinIndex := currPlayerDownsync.JoinIndex diff --git a/jsexport/main.go b/jsexport/main.go index 5968fe2..4996fe8 100644 --- a/jsexport/main.go +++ b/jsexport/main.go @@ -106,9 +106,9 @@ func GetCharacterConfigsOrderedByJoinIndex(speciesIdList []int) []*js.Object { return ret } -func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(inputsBuffer *resolv.RingBuffer, currRenderFrameId int32, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, collisionSpaceOffsetX, collisionSpaceOffsetY float64, chConfigsOrderedByJoinIndex []*CharacterConfig, renderFrameBuffer *resolv.RingBuffer, collision *resolv.Collision, effPushbacks []*Vec2D, hardPushbackNormsArr [][]*Vec2D, jumpedOrNotList []bool, dynamicRectangleColliders []*resolv.Object) bool { +func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(inputsBuffer *resolv.RingBuffer, currRenderFrameId int32, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, collisionSpaceOffsetX, collisionSpaceOffsetY float64, chConfigsOrderedByJoinIndex []*CharacterConfig, renderFrameBuffer *resolv.RingBuffer, collision *resolv.Collision, effPushbacks []*Vec2D, hardPushbackNormsArr [][]*Vec2D, jumpedOrNotList []bool, dynamicRectangleColliders []*resolv.Object, lastIndividuallyConfirmedInputFrameId []int32, lastIndividuallyConfirmedInputList []uint64) bool { // We need access to all fields of RoomDownsyncFrame for displaying in frontend - return ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer, currRenderFrameId, collisionSys, collisionSysMap, collisionSpaceOffsetX, collisionSpaceOffsetY, chConfigsOrderedByJoinIndex, renderFrameBuffer, collision, effPushbacks, hardPushbackNormsArr, jumpedOrNotList, dynamicRectangleColliders) + return ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(inputsBuffer, currRenderFrameId, collisionSys, collisionSysMap, collisionSpaceOffsetX, collisionSpaceOffsetY, chConfigsOrderedByJoinIndex, renderFrameBuffer, collision, effPushbacks, hardPushbackNormsArr, jumpedOrNotList, dynamicRectangleColliders, lastIndividuallyConfirmedInputFrameId, lastIndividuallyConfirmedInputList) } func GetRoomDownsyncFrame(renderFrameBuffer *resolv.RingBuffer, frameId int32) *js.Object {