diff --git a/battle_srv/api/v1/player.go b/battle_srv/api/v1/player.go index 9e51754..997727c 100644 --- a/battle_srv/api/v1/player.go +++ b/battle_srv/api/v1/player.go @@ -5,7 +5,7 @@ import ( . "battle_srv/common" "battle_srv/common/utils" "battle_srv/models" - . "jsexport/protos" + . "battle_srv/protos" "battle_srv/storage" "bytes" "crypto/sha256" diff --git a/battle_srv/env_tools/load_pre_conf.go b/battle_srv/env_tools/load_pre_conf.go index 52599a3..09be2b0 100644 --- a/battle_srv/env_tools/load_pre_conf.go +++ b/battle_srv/env_tools/load_pre_conf.go @@ -4,7 +4,7 @@ import ( . "battle_srv/common" "battle_srv/common/utils" "battle_srv/models" - . "jsexport/protos" + . "battle_srv/protos" "battle_srv/storage" . "dnmshared" sq "github.com/Masterminds/squirrel" diff --git a/battle_srv/env_tools/test_env_db.go b/battle_srv/env_tools/test_env_db.go index ecb7d42..aa3c74b 100644 --- a/battle_srv/env_tools/test_env_db.go +++ b/battle_srv/env_tools/test_env_db.go @@ -4,7 +4,7 @@ import ( . "battle_srv/common" "battle_srv/common/utils" "battle_srv/models" - . "jsexport/protos" + . "battle_srv/protos" "battle_srv/storage" . "dnmshared" diff --git a/battle_srv/models/pb_type_convert.go b/battle_srv/models/pb_type_convert.go index 6418772..2d0a7a1 100644 --- a/battle_srv/models/pb_type_convert.go +++ b/battle_srv/models/pb_type_convert.go @@ -1,17 +1,52 @@ package models import ( - . "jsexport/protos" + pb "battle_srv/protos" + "jsexport/battle" ) -func toPbPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]*PlayerDownsync { - toRet := make(map[int32]*PlayerDownsync, 0) +func toPbPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]*pb.PlayerDownsync { + toRet := make(map[int32]*pb.PlayerDownsync, 0) if nil == modelInstances { return toRet } for k, last := range modelInstances { - toRet[k] = &PlayerDownsync{ + toRet[k] = &pb.PlayerDownsync{ + Id: last.Id, + VirtualGridX: last.VirtualGridX, + VirtualGridY: last.VirtualGridY, + DirX: last.DirX, + DirY: last.DirY, + VelX: last.VelX, + VelY: last.VelY, + Speed: last.Speed, + BattleState: last.BattleState, + CharacterState: last.CharacterState, + InAir: last.InAir, + JoinIndex: last.JoinIndex, + ColliderRadius: last.ColliderRadius, + Score: last.Score, + Removed: last.Removed, + } + if withMetaInfo { + toRet[k].Name = last.Name + toRet[k].DisplayName = last.DisplayName + toRet[k].Avatar = last.Avatar + } + } + + return toRet +} + +func toJsPlayers(modelInstances map[int32]*Player, withMetaInfo bool) map[int32]*battle.PlayerDownsync { + toRet := make(map[int32]*battle.PlayerDownsync, 0) + if nil == modelInstances { + return toRet + } + + for k, last := range modelInstances { + toRet[k] = &battle.PlayerDownsync{ Id: last.Id, VirtualGridX: last.VirtualGridX, VirtualGridY: last.VirtualGridY, diff --git a/battle_srv/models/player.go b/battle_srv/models/player.go index e0aea76..11fe20e 100644 --- a/battle_srv/models/player.go +++ b/battle_srv/models/player.go @@ -1,7 +1,7 @@ package models import ( - . "jsexport/protos" + . "battle_srv/protos" "battle_srv/storage" . "dnmshared" "fmt" diff --git a/battle_srv/models/room.go b/battle_srv/models/room.go index 66b16da..033b576 100644 --- a/battle_srv/models/room.go +++ b/battle_srv/models/room.go @@ -3,10 +3,8 @@ package models import ( . "battle_srv/common" "battle_srv/common/utils" - . "jsexport/protos" - . "jsexport/models" + pb "battle_srv/protos" . "dnmshared" - . "dnmshared/sharedprotos" "encoding/xml" "fmt" "github.com/golang/protobuf/proto" @@ -14,6 +12,7 @@ import ( "github.com/solarlune/resolv" "go.uber.org/zap" "io/ioutil" + "jsexport/battle" "math/rand" "os" "path/filepath" @@ -116,7 +115,7 @@ type Room struct { * Moreover, during the invocation of `PlayerSignalToCloseDict`, the `Player` instance is supposed to be deallocated (though not synchronously). */ PlayerDownsyncSessionDict map[int32]*websocket.Conn - PlayerDownsyncChanDict map[int32](chan InputsBufferSnapshot) + PlayerDownsyncChanDict map[int32](chan pb.InputsBufferSnapshot) PlayerActiveWatchdogDict map[int32](*Watchdog) PlayerSignalToCloseDict map[int32]SignalToCloseConnCbType Score float32 @@ -126,7 +125,6 @@ type Room struct { CurDynamicsRenderFrameId int32 // [WARNING] The dynamics of backend is ALWAYS MOVING FORWARD BY ALL-CONFIRMED INPUTFRAMES (either by upsync or forced), i.e. no rollback; Moreover when "true == BackendDynamicsEnabled" we always have "Room.CurDynamicsRenderFrameId >= Room.RenderFrameId" because each "all-confirmed inputFrame" is applied on "all applicable renderFrames" in one-go hence often sees a future "renderFrame" earlier EffectivePlayerCount int32 DismissalWaitGroup sync.WaitGroup - Barriers map[int32]*Barrier InputsBuffer *RingBuffer // Indices are STRICTLY consecutive InputsBufferLock sync.Mutex // Guards [InputsBuffer, LatestPlayerUpsyncedInputFrameId, LastAllConfirmedInputFrameId, LastAllConfirmedInputList, LastAllConfirmedInputFrameIdWithChange] RenderFrameBuffer *RingBuffer // Indices are STRICTLY consecutive @@ -144,7 +142,10 @@ type Room struct { BulletBattleLocalIdCounter int32 dilutedRollbackEstimatedDtNanos int64 - BattleColliderInfo // Compositing to send centralized magic numbers + pb.BattleColliderInfo // Compositing to send centralized magic numbers + + TmxPointsMap StrToVec2DListMap + TmxPolygonsMap StrToPolygon2DListMap } func (pR *Room) updateScore() { @@ -287,24 +288,8 @@ func (pR *Room) ChooseStage() error { pR.StageDiscreteH = stageDiscreteH pR.StageTileW = stageTileW pR.StageTileH = stageTileH - pR.StrToVec2DListMap = strToVec2DListMap - pR.StrToPolygon2DListMap = strToPolygon2DListMap - - barrierPolygon2DList := *(strToPolygon2DListMap["Barrier"]) - - var barrierLocalIdInBattle int32 = 0 - for _, polygon2DUnaligned := range barrierPolygon2DList.Eles { - polygon2D := AlignPolygon2DToBoundingBox(polygon2DUnaligned) - /* - // For debug-printing only. - Logger.Info("ChooseStage printing polygon2D for barrierPolygon2DList", zap.Any("barrierLocalIdInBattle", barrierLocalIdInBattle), zap.Any("polygon2D.Anchor", polygon2D.Anchor), zap.Any("polygon2D.Points", polygon2D.Points)) - */ - pR.Barriers[barrierLocalIdInBattle] = &Barrier{ - Boundary: polygon2D, - } - - barrierLocalIdInBattle++ - } + pR.TmxPointsMap = strToVec2DListMap + pR.TmxPolygonsMap = strToPolygon2DListMap return nil } @@ -345,7 +330,7 @@ func (pR *Room) InputsBufferString(allDetails bool) string { if nil == tmp { break } - f := tmp.(*InputFrameDownsync) + f := tmp.(*pb.InputFrameDownsync) s = append(s, fmt.Sprintf("{\"inputFrameId\":%d,\"inputList\":%v,\"confirmedList\":\"%d\"}", f.InputFrameId, f.InputList, f.ConfirmedList)) } @@ -365,12 +350,12 @@ func (pR *Room) StartBattle() { // Initialize the "collisionSys" as well as "RenderFrameBuffer" pR.CurDynamicsRenderFrameId = 0 - kickoffFrame := &RoomDownsyncFrame{ + kickoffFrameJs := &battle.RoomDownsyncFrame{ Id: pR.RenderFrameId, - Players: toPbPlayers(pR.Players, false), + Players: toJsPlayers(pR.Players, false), CountdownNanos: pR.BattleDurationNanos, } - pR.RenderFrameBuffer.Put(kickoffFrame) + pR.RenderFrameBuffer.Put(kickoffFrameJs) // Refresh "Colliders" spaceW := pR.StageDiscreteW * pR.StageTileW @@ -435,7 +420,11 @@ func (pR *Room) StartBattle() { case PlayerBattleStateIns.DISCONNECTED, PlayerBattleStateIns.LOST, PlayerBattleStateIns.EXPELLED_DURING_GAME, PlayerBattleStateIns.EXPELLED_IN_DISMISSAL: continue } - kickoffFrame := pR.RenderFrameBuffer.GetByFrameId(0).(*RoomDownsyncFrame) + kickoffFrame := &pb.RoomDownsyncFrame{ + Id: pR.RenderFrameId, + Players: toPbPlayers(pR.Players, false), + CountdownNanos: pR.BattleDurationNanos, + } pR.sendSafely(kickoffFrame, nil, DOWNSYNC_MSG_ACT_BATTLE_START, playerId, true) } Logger.Info(fmt.Sprintf("In `battleMainLoop` for roomId=%v sent out kickoffFrame", pR.Id)) @@ -463,7 +452,7 @@ func (pR *Room) StartBattle() { } } - downsyncLoop := func(playerId int32, player *Player, playerDownsyncChan chan InputsBufferSnapshot) { + downsyncLoop := func(playerId int32, player *Player, playerDownsyncChan chan pb.InputsBufferSnapshot) { defer func() { if r := recover(); r != nil { Logger.Error("downsyncLoop, recovery spot#1, recovered from: ", zap.Any("roomId", pR.Id), zap.Any("playerId", playerId), zap.Any("panic", r)) @@ -495,7 +484,7 @@ func (pR *Room) StartBattle() { Each "playerDownsyncChan" stays alive through out the lifecycle of room instead of each "playerDownsyncSession", i.e. not closed or dereferenced upon disconnection. */ - pR.PlayerDownsyncChanDict[playerId] = make(chan InputsBufferSnapshot, pR.InputsBuffer.N) + pR.PlayerDownsyncChanDict[playerId] = make(chan pb.InputsBufferSnapshot, pR.InputsBuffer.N) go downsyncLoop(playerId, player, pR.PlayerDownsyncChanDict[playerId]) } @@ -509,7 +498,7 @@ func (pR *Room) toDiscreteInputsBufferIndex(inputFrameId int32, joinIndex int32) return (inputFrameId << 2) + joinIndex // allowing joinIndex upto 15 } -func (pR *Room) OnBattleCmdReceived(pReq *WsReq) { +func (pR *Room) OnBattleCmdReceived(pReq *pb.WsReq) { /* [WARNING] This function "OnBattleCmdReceived" could be called by different ws sessions and thus from different threads! @@ -560,7 +549,7 @@ func (pR *Room) OnBattleCmdReceived(pReq *WsReq) { } } -func (pR *Room) onInputFrameDownsyncAllConfirmed(inputFrameDownsync *InputFrameDownsync, playerId int32) { +func (pR *Room) onInputFrameDownsyncAllConfirmed(inputFrameDownsync *pb.InputFrameDownsync, playerId int32) { // [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked! inputFrameId := inputFrameDownsync.InputFrameId if -1 == pR.LastAllConfirmedInputFrameIdWithChange || false == pR.equalInputLists(inputFrameDownsync.InputList, pR.LastAllConfirmedInputList) { @@ -603,7 +592,7 @@ func (pR *Room) StopBattleForSettlement() { Logger.Info("Stopping the `battleMainLoop` for:", zap.Any("roomId", pR.Id)) pR.RenderFrameId++ for playerId, _ := range pR.Players { - assembledFrame := RoomDownsyncFrame{ + assembledFrame := pb.RoomDownsyncFrame{ Id: pR.RenderFrameId, Players: toPbPlayers(pR.Players, false), CountdownNanos: -1, // TODO: Replace this magic constant! @@ -629,7 +618,7 @@ func (pR *Room) onBattlePrepare(cb BattleStartCbType) { pR.State = RoomBattleStateIns.PREPARE Logger.Info("Battle state transitted to RoomBattleStateIns.PREPARE for:", zap.Any("roomId", pR.Id)) - battleReadyToStartFrame := &RoomDownsyncFrame{ + battleReadyToStartFrame := &pb.RoomDownsyncFrame{ Id: DOWNSYNC_MSG_ACT_BATTLE_READY_TO_START, Players: toPbPlayers(pR.Players, true), CountdownNanos: pR.BattleDurationNanos, @@ -714,10 +703,9 @@ func (pR *Room) OnDismissed() { for _, oldChan := range pR.PlayerDownsyncChanDict { close(oldChan) } - pR.PlayerDownsyncChanDict = make(map[int32](chan InputsBufferSnapshot)) + pR.PlayerDownsyncChanDict = make(map[int32](chan pb.InputsBufferSnapshot)) pR.PlayerSignalToCloseDict = make(map[int32]SignalToCloseConnCbType) pR.JoinIndexBooleanArr = make([]bool, pR.Capacity) - pR.Barriers = make(map[int32]*Barrier) pR.RenderCacheSize = 1024 pR.RenderFrameBuffer = NewRingBuffer(pR.RenderCacheSize) pR.InputsBuffer = NewRingBuffer((pR.RenderCacheSize >> 1) + 1) @@ -745,23 +733,15 @@ func (pR *Room) OnDismissed() { pR.BackendDynamicsEnabled = true // [WARNING] When "false", recovery upon reconnection wouldn't work! pR.ForceAllResyncOnAnyActiveSlowTicker = true // See tradeoff discussion in "downsyncToAllPlayers" punchSkillId := int32(1) - pR.MeleeSkillConfig = make(map[int32]*MeleeBullet, 0) - pR.MeleeSkillConfig[punchSkillId] = &MeleeBullet{ + pR.MeleeSkillConfig = make(map[int32]*pb.MeleeBullet, 0) + pR.MeleeSkillConfig[punchSkillId] = &pb.MeleeBullet{ // for offender StartupFrames: int32(10), ActiveFrames: int32(10), RecoveryFrames: int32(34), RecoveryFramesOnBlock: int32(34), RecoveryFramesOnHit: int32(34), - Moveforward: &Vec2D{ - X: 0, - Y: 0, - }, - HitboxOffset: float64(12.0), // should be about the radius of the PlayerCollider - HitboxSize: &Vec2D{ - X: float64(24.0), - Y: float64(32.0), - }, + HitboxOffset: float64(12.0), // should be about the radius of the PlayerCollider // for defender HitStunFrames: int32(18), @@ -769,6 +749,11 @@ func (pR *Room) OnDismissed() { Pushback: float64(8.0), ReleaseTriggerType: int32(1), // 1: rising-edge, 2: falling-edge Damage: int32(5), + + SelfMoveforwardX: 0, + SelfMoveforwardY: 0, + HitboxSizeX: 24.0, + HitboxSizeY: 32.0, } pR.SnapIntoPlatformOverlap = float64(0.1) @@ -893,16 +878,16 @@ func (pR *Room) onPlayerAdded(playerId int32) { pR.JoinIndexBooleanArr[index] = true // Lazily assign the initial position of "Player" for "RoomDownsyncFrame". - playerPosList := *(pR.StrToVec2DListMap["PlayerStartingPos"]) - if index > len(playerPosList.Eles) { + playerPosList := pR.TmxPointsMap["PlayerStartingPos"] + if index > len(playerPosList) { panic(fmt.Sprintf("onPlayerAdded error, index >= len(playerPosList), roomId=%v, playerId=%v, roomState=%v, roomEffectivePlayerCount=%v", pR.Id, playerId, pR.State, pR.EffectivePlayerCount)) } - playerPos := playerPosList.Eles[index] + playerPos := playerPosList[index] if nil == playerPos { panic(fmt.Sprintf("onPlayerAdded error, nil == playerPos, roomId=%v, playerId=%v, roomState=%v, roomEffectivePlayerCount=%v", pR.Id, playerId, pR.State, pR.EffectivePlayerCount)) } - pR.Players[playerId].VirtualGridX, pR.Players[playerId].VirtualGridY = WorldToVirtualGridPos(playerPos.X, playerPos.Y, pR.WorldToVirtualGridRatio) + pR.Players[playerId].VirtualGridX, pR.Players[playerId].VirtualGridY = battle.WorldToVirtualGridPos(playerPos.X, playerPos.Y, pR.WorldToVirtualGridRatio) // Hardcoded initial character orientation/facing if 0 == (pR.Players[playerId].JoinIndex % 2) { pR.Players[playerId].DirX = -2 @@ -942,7 +927,7 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool { targetPlayerBattleState := atomic.LoadInt32(&(targetPlayer.BattleState)) switch targetPlayerBattleState { case PlayerBattleStateIns.ADDED_PENDING_BATTLE_COLLIDER_ACK: - playerAckedFrame := &RoomDownsyncFrame{ + playerAckedFrame := &pb.RoomDownsyncFrame{ Id: pR.RenderFrameId, Players: toPbPlayers(pR.Players, true), } @@ -995,7 +980,7 @@ func (pR *Room) OnPlayerBattleColliderAcked(playerId int32) bool { return true } -func (pR *Room) sendSafely(roomDownsyncFrame *RoomDownsyncFrame, toSendInputFrameDownsyncs []*InputFrameDownsync, act int32, playerId int32, needLockExplicitly bool) { +func (pR *Room) sendSafely(roomDownsyncFrame *pb.RoomDownsyncFrame, toSendInputFrameDownsyncs []*pb.InputFrameDownsync, act int32, playerId int32, needLockExplicitly bool) { defer func() { if r := recover(); r != nil { Logger.Error("sendSafely, recovered from: ", zap.Any("roomId", pR.Id), zap.Any("playerId", playerId), zap.Any("panic", r)) @@ -1003,7 +988,7 @@ func (pR *Room) sendSafely(roomDownsyncFrame *RoomDownsyncFrame, toSendInputFram }() if playerDownsyncSession, existent := pR.PlayerDownsyncSessionDict[playerId]; existent { - pResp := &WsResp{ + pResp := &pb.WsResp{ Ret: int32(Constants.RetCode.Ok), Act: act, Rdf: roomDownsyncFrame, @@ -1030,7 +1015,7 @@ func (pR *Room) shouldPrefabInputFrameDownsync(prevRenderFrameId int32, renderFr return false, -1 } -func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *InputFrameDownsync { +func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *pb.InputFrameDownsync { /* [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked. @@ -1039,12 +1024,12 @@ func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *InputFrameDow - OR there's no change w.r.t. to its prev cmd. */ - var currInputFrameDownsync *InputFrameDownsync = nil + var currInputFrameDownsync *pb.InputFrameDownsync = nil tmp1 := pR.InputsBuffer.GetByFrameId(inputFrameId) // Would be nil if "pR.InputsBuffer.EdFrameId <= inputFrameId", else if "pR.InputsBuffer.EdFrameId > inputFrameId" is already met, then by now we can just return "tmp1.(*InputFrameDownsync)" if nil == tmp1 { for pR.InputsBuffer.EdFrameId <= inputFrameId { j := pR.InputsBuffer.EdFrameId - currInputFrameDownsync = &InputFrameDownsync{ + currInputFrameDownsync = &pb.InputFrameDownsync{ InputFrameId: j, InputList: make([]uint64, pR.Capacity), ConfirmedList: uint64(0), @@ -1056,7 +1041,7 @@ func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *InputFrameDow } tmp2 := pR.InputsBuffer.GetByFrameId(j2) if nil != tmp2 { - prevInputFrameDownsync := tmp2.(*InputFrameDownsync) + prevInputFrameDownsync := tmp2.(*pb.InputFrameDownsync) for i, _ := range currInputFrameDownsync.InputList { currInputFrameDownsync.InputList[i] = (prevInputFrameDownsync.InputList[i] & uint64(15)) // Don't predict attack input! } @@ -1065,13 +1050,13 @@ func (pR *Room) getOrPrefabInputFrameDownsync(inputFrameId int32) *InputFrameDow pR.InputsBuffer.Put(currInputFrameDownsync) } } else { - currInputFrameDownsync = tmp1.(*InputFrameDownsync) + currInputFrameDownsync = tmp1.(*pb.InputFrameDownsync) } return currInputFrameDownsync } -func (pR *Room) markConfirmationIfApplicable(inputFrameUpsyncBatch []*InputFrameUpsync, playerId int32, player *Player) *InputsBufferSnapshot { +func (pR *Room) markConfirmationIfApplicable(inputFrameUpsyncBatch []*pb.InputFrameUpsync, playerId int32, player *Player) *pb.InputsBufferSnapshot { // [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked! // Step#1, put the received "inputFrameUpsyncBatch" into "pR.InputsBuffer" for _, inputFrameUpsync := range inputFrameUpsyncBatch { @@ -1111,7 +1096,7 @@ func (pR *Room) markConfirmationIfApplicable(inputFrameUpsyncBatch []*InputFrame panic(fmt.Sprintf("inputFrameId=%v doesn't exist for roomId=%v! InputsBuffer=%v", inputFrameId, pR.Id, pR.InputsBufferString(false))) } shouldBreakConfirmation := false - inputFrameDownsync := tmp.(*InputFrameDownsync) + inputFrameDownsync := tmp.(*pb.InputFrameDownsync) if allConfirmedMask != inputFrameDownsync.ConfirmedList { for _, player := range pR.PlayersArr { @@ -1170,7 +1155,7 @@ func (pR *Room) forceConfirmationIfApplicable(prevRenderFrameId int32) uint64 { if nil == tmp { panic(fmt.Sprintf("inputFrameId=%v doesn't exist for roomId=%v! InputsBuffer=%v", j, pR.Id, pR.InputsBufferString(false))) } - inputFrameDownsync := tmp.(*InputFrameDownsync) + inputFrameDownsync := tmp.(*pb.InputFrameDownsync) unconfirmedMask |= (allConfirmedMask ^ inputFrameDownsync.ConfirmedList) inputFrameDownsync.ConfirmedList = allConfirmedMask pR.onInputFrameDownsyncAllConfirmed(inputFrameDownsync, -1) @@ -1197,7 +1182,7 @@ func (pR *Room) forceConfirmationIfApplicable(prevRenderFrameId int32) uint64 { return unconfirmedMask } -func (pR *Room) produceInputsBufferSnapshotWithCurDynamicsRenderFrameAsRef(unconfirmedMask uint64, snapshotStFrameId, snapshotEdFrameId int32) *InputsBufferSnapshot { +func (pR *Room) produceInputsBufferSnapshotWithCurDynamicsRenderFrameAsRef(unconfirmedMask uint64, snapshotStFrameId, snapshotEdFrameId int32) *pb.InputsBufferSnapshot { // [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked! refRenderFrameIdIfNeeded := pR.CurDynamicsRenderFrameId - 1 if 0 > refRenderFrameIdIfNeeded { @@ -1206,7 +1191,7 @@ func (pR *Room) produceInputsBufferSnapshotWithCurDynamicsRenderFrameAsRef(uncon // Duplicate downsynced inputFrameIds will be filtered out by frontend. toSendInputFrameDownsyncs := pR.cloneInputsBuffer(snapshotStFrameId, snapshotEdFrameId) - return &InputsBufferSnapshot{ + return &pb.InputsBufferSnapshot{ RefRenderFrameId: refRenderFrameIdIfNeeded, UnconfirmedMask: unconfirmedMask, ToSendInputFrameDownsyncs: toSendInputFrameDownsyncs, @@ -1228,9 +1213,9 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende if nil == currRenderFrameTmp { panic(fmt.Sprintf("collisionSysRenderFrameId=%v doesn't exist for roomId=%v, this is abnormal because it's to be used for applying dynamics to [fromRenderFrameId:%v, toRenderFrameId:%v)! RenderFrameBuffer=%v", collisionSysRenderFrameId, pR.Id, fromRenderFrameId, toRenderFrameId, pR.RenderFrameBufferString())) } - currRenderFrame := currRenderFrameTmp.(*RoomDownsyncFrame) + currRenderFrame := currRenderFrameTmp.(*battle.RoomDownsyncFrame) delayedInputFrameId := pR.ConvertToInputFrameId(collisionSysRenderFrameId, pR.InputDelayFrames) - var delayedInputFrame *InputFrameDownsync = nil + var delayedInputFrame *pb.InputFrameDownsync = nil if 0 <= delayedInputFrameId { if delayedInputFrameId > pR.LastAllConfirmedInputFrameId { panic(fmt.Sprintf("delayedInputFrameId=%v is not yet all-confirmed for roomId=%v, this is abnormal because it's to be used for applying dynamics to [fromRenderFrameId:%v, toRenderFrameId:%v) @ collisionSysRenderFrameId=%v! InputsBuffer=%v", delayedInputFrameId, pR.Id, fromRenderFrameId, toRenderFrameId, collisionSysRenderFrameId, pR.InputsBufferString(false))) @@ -1239,7 +1224,7 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende if nil == tmp { panic(fmt.Sprintf("delayedInputFrameId=%v doesn't exist for roomId=%v, this is abnormal because it's to be used for applying dynamics to [fromRenderFrameId:%v, toRenderFrameId:%v) @ collisionSysRenderFrameId=%v! InputsBuffer=%v", delayedInputFrameId, pR.Id, fromRenderFrameId, toRenderFrameId, collisionSysRenderFrameId, pR.InputsBufferString(false))) } - delayedInputFrame = tmp.(*InputFrameDownsync) + delayedInputFrame = tmp.(*pb.InputFrameDownsync) // [WARNING] It's possible that by now "allConfirmedMask != delayedInputFrame.ConfirmedList && delayedInputFrameId <= pR.LastAllConfirmedInputFrameId", we trust "pR.LastAllConfirmedInputFrameId" as the TOP AUTHORITY. delayedInputFrame.ConfirmedList = allConfirmedMask } @@ -1250,370 +1235,6 @@ func (pR *Room) applyInputFrameDownsyncDynamics(fromRenderFrameId int32, toRende } } -// TODO: Write unit-test for this function to compare with its frontend counter part -func (pR *Room) applyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputFrame *InputFrameDownsync, currRenderFrame *RoomDownsyncFrame, collisionSysMap map[int32]*resolv.Object) *RoomDownsyncFrame { - topPadding, bottomPadding, leftPadding, rightPadding := pR.SnapIntoPlatformOverlap, pR.SnapIntoPlatformOverlap, pR.SnapIntoPlatformOverlap, pR.SnapIntoPlatformOverlap - // [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked! - nextRenderFramePlayers := make(map[int32]*PlayerDownsync, pR.Capacity) - // Make a copy first - for playerId, currPlayerDownsync := range currRenderFrame.Players { - nextRenderFramePlayers[playerId] = &PlayerDownsync{ - Id: playerId, - VirtualGridX: currPlayerDownsync.VirtualGridX, - VirtualGridY: currPlayerDownsync.VirtualGridY, - DirX: currPlayerDownsync.DirX, - DirY: currPlayerDownsync.DirY, - VelX: currPlayerDownsync.VelX, - VelY: currPlayerDownsync.VelY, - CharacterState: currPlayerDownsync.CharacterState, - InAir: true, - Speed: currPlayerDownsync.Speed, - BattleState: currPlayerDownsync.BattleState, - Score: currPlayerDownsync.Score, - Removed: currPlayerDownsync.Removed, - JoinIndex: currPlayerDownsync.JoinIndex, - FramesToRecover: currPlayerDownsync.FramesToRecover - 1, - Hp: currPlayerDownsync.Hp, - MaxHp: currPlayerDownsync.MaxHp, - } - if nextRenderFramePlayers[playerId].FramesToRecover < 0 { - nextRenderFramePlayers[playerId].FramesToRecover = 0 - } - } - - nextRenderFrameMeleeBullets := make([]*MeleeBullet, 0, len(currRenderFrame.MeleeBullets)) // Is there any better way to reduce malloc/free impact, e.g. smart prediction for fixed memory allocation? - effPushbacks := make([]Vec2D, pR.Capacity) - hardPushbackNorms := make([][]Vec2D, pR.Capacity) - - // 1. Process player inputs - if nil != delayedInputFrame { - var delayedInputFrameForPrevRenderFrame *InputFrameDownsync = nil - tmp := pR.InputsBuffer.GetByFrameId(pR.ConvertToInputFrameId(currRenderFrame.Id-1, pR.InputDelayFrames)) - if nil != tmp { - delayedInputFrameForPrevRenderFrame = tmp.(*InputFrameDownsync) - } - inputList := delayedInputFrame.InputList - for _, player := range pR.PlayersArr { - playerId := player.Id - joinIndex := player.JoinIndex - currPlayerDownsync, thatPlayerInNextFrame := currRenderFrame.Players[playerId], nextRenderFramePlayers[playerId] - if 0 < thatPlayerInNextFrame.FramesToRecover { - continue - } - decodedInput := pR.decodeInput(inputList[joinIndex-1]) - prevBtnALevel, prevBtnBLevel := int32(0), int32(0) - if nil != delayedInputFrameForPrevRenderFrame { - prevDecodedInput := pR.decodeInput(delayedInputFrameForPrevRenderFrame.InputList[joinIndex-1]) - prevBtnALevel = prevDecodedInput.BtnALevel - prevBtnBLevel = prevDecodedInput.BtnBLevel - } - - if decodedInput.BtnBLevel > prevBtnBLevel { - characStateAlreadyInAir := false - if ATK_CHARACTER_STATE_INAIR_IDLE1 == thatPlayerInNextFrame.CharacterState || ATK_CHARACTER_STATE_INAIR_ATK1 == thatPlayerInNextFrame.CharacterState || ATK_CHARACTER_STATE_INAIR_ATKED1 == thatPlayerInNextFrame.CharacterState { - characStateAlreadyInAir = true - } - characStateIsInterruptWaivable := false - if ATK_CHARACTER_STATE_IDLE1 == thatPlayerInNextFrame.CharacterState || ATK_CHARACTER_STATE_WALKING == thatPlayerInNextFrame.CharacterState || ATK_CHARACTER_STATE_INAIR_IDLE1 == thatPlayerInNextFrame.CharacterState { - characStateIsInterruptWaivable = true - } - if !characStateAlreadyInAir && characStateIsInterruptWaivable { - thatPlayerInNextFrame.VelY = pR.JumpingInitVelY - if 1 == currPlayerDownsync.JoinIndex { - Logger.Info(fmt.Sprintf("playerId=%v, joinIndex=%v jumped at {renderFrame.id: %d, virtualX: %d, virtualY: %d, nextVelX: %d, nextVelY: %d, nextCharacterState=%d, inAir=%v}, delayedInputFrame.id=%d", playerId, joinIndex, currRenderFrame.Id, currPlayerDownsync.VirtualGridX, currPlayerDownsync.VirtualGridY, thatPlayerInNextFrame.VelX, thatPlayerInNextFrame.VelY, thatPlayerInNextFrame.CharacterState, currPlayerDownsync.InAir, delayedInputFrame.InputFrameId)) - } - } - } - - if decodedInput.BtnALevel > prevBtnALevel { - punchSkillId := int32(1) - punchConfig := pR.MeleeSkillConfig[punchSkillId] - var newMeleeBullet MeleeBullet = *punchConfig - newMeleeBullet.BattleLocalId = pR.BulletBattleLocalIdCounter - pR.BulletBattleLocalIdCounter += 1 - newMeleeBullet.OffenderJoinIndex = joinIndex - newMeleeBullet.OffenderPlayerId = playerId - newMeleeBullet.OriginatedRenderFrameId = currRenderFrame.Id - nextRenderFrameMeleeBullets = append(nextRenderFrameMeleeBullets, &newMeleeBullet) - thatPlayerInNextFrame.FramesToRecover = newMeleeBullet.RecoveryFrames - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_ATK1 - if false == currPlayerDownsync.InAir { - thatPlayerInNextFrame.VelX = 0 - } - Logger.Debug(fmt.Sprintf("roomId=%v, playerId=%v triggered a rising-edge of btnA at currRenderFrame.id=%v, delayedInputFrame.id=%v", pR.Id, playerId, currRenderFrame.Id, delayedInputFrame.InputFrameId)) - - } else if decodedInput.BtnALevel < prevBtnALevel { - Logger.Debug(fmt.Sprintf("roomId=%v, playerId=%v triggered a falling-edge of btnA at currRenderFrame.id=%v, delayedInputFrame.id=%v", pR.Id, playerId, currRenderFrame.Id, delayedInputFrame.InputFrameId)) - } else { - // No bullet trigger, process movement inputs - // Note that by now "0 == thatPlayerInNextFrame.FramesToRecover", we should change "CharacterState" to "WALKING" or "IDLE" depending on player inputs - if 0 != decodedInput.Dx || 0 != decodedInput.Dy { - thatPlayerInNextFrame.DirX = decodedInput.Dx - thatPlayerInNextFrame.DirY = decodedInput.Dy - thatPlayerInNextFrame.VelX = decodedInput.Dx * currPlayerDownsync.Speed - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_WALKING - } else { - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_IDLE1 - thatPlayerInNextFrame.VelX = 0 - } - } - } - } - - // 2. Process player movement - for _, player := range pR.PlayersArr { - playerId := player.Id - joinIndex := player.JoinIndex - effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y = float64(0), float64(0) - collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex - playerCollider := collisionSysMap[collisionPlayerIndex] - currPlayerDownsync, thatPlayerInNextFrame := currRenderFrame.Players[playerId], nextRenderFramePlayers[playerId] - // Reset playerCollider position from the "virtual grid position" - newVx, newVy := currPlayerDownsync.VirtualGridX+currPlayerDownsync.VelX, currPlayerDownsync.VirtualGridY+currPlayerDownsync.VelY - if thatPlayerInNextFrame.VelY == pR.JumpingInitVelY { - newVy += thatPlayerInNextFrame.VelY - } - - halfColliderWidth, halfColliderHeight := player.ColliderRadius, player.ColliderRadius+player.ColliderRadius // avoid multiplying - playerCollider.X, playerCollider.Y = VirtualGridToPolygonColliderBLPos(newVx, newVy, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, pR.VirtualGridToWorldRatio) - // Update in the collision system - playerCollider.Update() - - if currPlayerDownsync.InAir { - thatPlayerInNextFrame.VelX += pR.GravityX - thatPlayerInNextFrame.VelY += pR.GravityY - } - } - - // 3. Add bullet colliders into collision system - bulletColliders := make(map[int32]*resolv.Object, 0) // Will all be removed at the end of `applyInputFrameDownsyncDynamicsOnSingleRenderFrame` due to the need for being rollback-compatible - removedBulletsAtCurrFrame := make(map[int32]int32, 0) - for _, meleeBullet := range currRenderFrame.MeleeBullets { - if (meleeBullet.OriginatedRenderFrameId+meleeBullet.StartupFrames <= currRenderFrame.Id) && (meleeBullet.OriginatedRenderFrameId+meleeBullet.StartupFrames+meleeBullet.ActiveFrames > currRenderFrame.Id) { - collisionBulletIndex := COLLISION_BULLET_INDEX_PREFIX + meleeBullet.BattleLocalId - collisionOffenderIndex := COLLISION_PLAYER_INDEX_PREFIX + meleeBullet.OffenderJoinIndex - offenderCollider := collisionSysMap[collisionOffenderIndex] - offender := currRenderFrame.Players[meleeBullet.OffenderPlayerId] - - xfac := float64(1.0) // By now, straight Punch offset doesn't respect "y-axis" - if 0 > offender.DirX { - xfac = float64(-1.0) - } - offenderWx, offenderWy := VirtualGridToWorldPos(offender.VirtualGridX, offender.VirtualGridY, pR.VirtualGridToWorldRatio) - bulletWx, bulletWy := offenderWx+xfac*meleeBullet.HitboxOffset, offenderWy - newBulletCollider := GenerateRectCollider(bulletWx, bulletWy, meleeBullet.HitboxSize.X, meleeBullet.HitboxSize.Y, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, meleeBullet, "MeleeBullet") - pR.Space.Add(newBulletCollider) - collisionSysMap[collisionBulletIndex] = newBulletCollider - bulletColliders[collisionBulletIndex] = newBulletCollider - - Logger.Debug(fmt.Sprintf("roomId=%v, a meleeBullet is added to collisionSys at currRenderFrame.id=%v as start-up frames ended and active frame is not yet ended: %v, from offenderCollider=%v, xfac=%v", pR.Id, currRenderFrame.Id, ConvexPolygonStr(newBulletCollider.Shape.(*resolv.ConvexPolygon)), ConvexPolygonStr(offenderCollider.Shape.(*resolv.ConvexPolygon)), xfac)) - } - } - - // 4. Invoke collision system stepping (no-op for backend collision lib) - - // 5. Calc pushbacks for each player (after its movement) w/o bullets - for _, player := range pR.PlayersArr { - joinIndex := player.JoinIndex - playerId := player.Id - collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex - playerCollider := collisionSysMap[collisionPlayerIndex] - playerShape := playerCollider.Shape.(*resolv.ConvexPolygon) - hardPushbackNorms[joinIndex-1] = pR.calcHardPushbacksNorms(playerCollider, playerShape, pR.SnapIntoPlatformOverlap, &(effPushbacks[joinIndex-1])) - currPlayerDownsync, thatPlayerInNextFrame := currRenderFrame.Players[playerId], nextRenderFramePlayers[playerId] - fallStopping := false - possiblyFallStoppedOnAnotherPlayer := false - if collision := playerCollider.Check(0, 0); nil != collision { - for _, obj := range collision.Objects { - isBarrier, isAnotherPlayer, isBullet := false, false, false - switch obj.Data.(type) { - case *Barrier: - isBarrier = true - case *Player: - isAnotherPlayer = true - case *MeleeBullet: - isBullet = true - } - if isBullet { - // ignore bullets for this step - continue - } - bShape := obj.Shape.(*resolv.ConvexPolygon) - overlapped, pushbackX, pushbackY, overlapResult := CalcPushbacks(0, 0, playerShape, bShape) - if !overlapped { - continue - } - normAlignmentWithGravity := (overlapResult.OverlapX*float64(0) + overlapResult.OverlapY*float64(-1.0)) - landedOnGravityPushback := (pR.SnapIntoPlatformThreshold < normAlignmentWithGravity) // prevents false snapping on the lateral sides - if landedOnGravityPushback { - // kindly note that one player might land on top of another player, and snapping is also required in such case - pushbackX, pushbackY = (overlapResult.Overlap-pR.SnapIntoPlatformOverlap)*overlapResult.OverlapX, (overlapResult.Overlap-pR.SnapIntoPlatformOverlap)*overlapResult.OverlapY - thatPlayerInNextFrame.InAir = false - } - if isAnotherPlayer { - // [WARNING] See comments of this substep in frontend. - pushbackX, pushbackY = (overlapResult.Overlap-pR.SnapIntoPlatformOverlap*2)*overlapResult.OverlapX, (overlapResult.Overlap-pR.SnapIntoPlatformOverlap*2)*overlapResult.OverlapY - } - for _, hardPushbackNorm := range hardPushbackNorms[joinIndex-1] { - projectedMagnitude := pushbackX*hardPushbackNorm.X + pushbackY*hardPushbackNorm.Y - if isBarrier || (isAnotherPlayer && 0 > projectedMagnitude) { - pushbackX -= projectedMagnitude * hardPushbackNorm.X - pushbackY -= projectedMagnitude * hardPushbackNorm.Y - } - } - effPushbacks[joinIndex-1].X += pushbackX - effPushbacks[joinIndex-1].Y += pushbackY - if currPlayerDownsync.InAir && landedOnGravityPushback { - fallStopping = true - if isAnotherPlayer { - possiblyFallStoppedOnAnotherPlayer = true - } - } - if 1 == joinIndex { - halfColliderWidth, halfColliderHeight := player.ColliderRadius, player.ColliderRadius+player.ColliderRadius // avoid multiplying - if fallStopping { - Logger.Debug(fmt.Sprintf("playerId=%d, joinIndex=%d fallStopping#1\n{renderFrame.id: %d, possiblyFallStoppedOnAnotherPlayer: %v}\nplayerColliderPos=%v, effPushback={%.3f, %.3f}, overlapMag=%.4f", playerId, joinIndex, currRenderFrame.Id, possiblyFallStoppedOnAnotherPlayer, RectCenterStr(playerCollider, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y, overlapResult.Overlap)) - } else if currPlayerDownsync.InAir && isBarrier && !landedOnGravityPushback { - //Logger.Warn(fmt.Sprintf("playerId=%d, joinIndex=%d inAir & pushed back by barrier & not landed at {renderFrame.id: %d}\nplayerColliderPos=%v, effPushback={%.3f, %.3f}, overlapMag=%.4f, len(hardPushbackNorms)=%d", playerId, joinIndex, currRenderFrame.Id, RectCenterStr(playerCollider, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y, overlapResult.Overlap, len(hardPushbackNorms))) - } else if currPlayerDownsync.InAir && isAnotherPlayer { - //Logger.Warn(fmt.Sprintf("playerId=%d, joinIndex=%d inAir & pushed back by another player\n{renderFrame.id: %d}\nplayerColliderPos=%v, anotherPlayerColliderPos=%v, effPushback={%.3f, %.3f}, landedOnGravityPushback=%v, fallStopping=%v, overlapMag=%.4f, len(hardPushbackNorms)=%d", playerId, joinIndex, currRenderFrame.Id, RectCenterStr(playerCollider, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), RectCenterStr(obj, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y, landedOnGravityPushback, fallStopping, overlapResult.Overlap, len(hardPushbackNorms))) - } - } - } - } - if fallStopping { - thatPlayerInNextFrame.VelX = 0 - thatPlayerInNextFrame.VelY = 0 - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_IDLE1 - thatPlayerInNextFrame.FramesToRecover = 0 - } - if currPlayerDownsync.InAir { - oldNextCharacterState := thatPlayerInNextFrame.CharacterState - switch oldNextCharacterState { - case ATK_CHARACTER_STATE_IDLE1, ATK_CHARACTER_STATE_WALKING: - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_INAIR_IDLE1 - case ATK_CHARACTER_STATE_ATK1: - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_INAIR_ATK1 - case ATK_CHARACTER_STATE_ATKED1: - thatPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_INAIR_ATKED1 - } - } - } - - // 6. Check bullet-anything collisions - for _, bulletCollider := range bulletColliders { - shouldRemove := false - meleeBullet := bulletCollider.Data.(*MeleeBullet) - collisionBulletIndex := COLLISION_BULLET_INDEX_PREFIX + meleeBullet.BattleLocalId - bulletShape := bulletCollider.Shape.(*resolv.ConvexPolygon) - if collision := bulletCollider.Check(0, 0); collision != nil { - offender := currRenderFrame.Players[meleeBullet.OffenderPlayerId] - for _, obj := range collision.Objects { - defenderShape := obj.Shape.(*resolv.ConvexPolygon) - switch t := obj.Data.(type) { - case *Player: - if meleeBullet.OffenderPlayerId != t.Id { - if overlapped, _, _, _ := CalcPushbacks(0, 0, bulletShape, defenderShape); overlapped { - joinIndex := t.JoinIndex - xfac := float64(1.0) // By now, straight Punch offset doesn't respect "y-axis" - if 0 > offender.DirX { - xfac = float64(-1.0) - } - pushbackX, pushbackY := -xfac*meleeBullet.Pushback, float64(0) - - for _, hardPushbackNorm := range hardPushbackNorms[joinIndex-1] { - projectedMagnitude := pushbackX*hardPushbackNorm.X + pushbackY*hardPushbackNorm.Y - if 0 > projectedMagnitude { - //Logger.Debug(fmt.Sprintf("defenderPlayerId=%d, joinIndex=%d reducing bullet pushback={%.3f, %.3f} by {%.3f, %.3f} where hardPushbackNorm={%.3f, %.3f}, projectedMagnitude=%.3f at renderFrame.id=%d", t.Id, joinIndex, pushbackX, pushbackY, projectedMagnitude*hardPushbackNorm.X, projectedMagnitude*hardPushbackNorm.Y, hardPushbackNorm.X, hardPushbackNorm.Y, projectedMagnitude, currRenderFrame.Id)) - pushbackX -= projectedMagnitude * hardPushbackNorm.X - pushbackY -= projectedMagnitude * hardPushbackNorm.Y - } - } - - effPushbacks[joinIndex-1].X += pushbackX - effPushbacks[joinIndex-1].Y += pushbackY - atkedPlayerInCurFrame, atkedPlayerInNextFrame := currRenderFrame.Players[t.Id], nextRenderFramePlayers[t.Id] - atkedPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_ATKED1 - if atkedPlayerInCurFrame.InAir { - atkedPlayerInNextFrame.CharacterState = ATK_CHARACTER_STATE_INAIR_ATKED1 - } - oldFramesToRecover := nextRenderFramePlayers[t.Id].FramesToRecover - if meleeBullet.HitStunFrames > oldFramesToRecover { - atkedPlayerInNextFrame.FramesToRecover = meleeBullet.HitStunFrames - } - Logger.Debug(fmt.Sprintf("roomId=%v, a meleeBullet collides w/ player at currRenderFrame.id=%v: b=%v, p=%v", pR.Id, currRenderFrame.Id, ConvexPolygonStr(bulletShape), ConvexPolygonStr(defenderShape))) - } - } - default: - Logger.Debug(fmt.Sprintf("Bullet %v collided with non-player %v: roomId=%v, currRenderFrame.Id=%v, delayedInputFrame.Id=%v, objDataType=%t, objData=%v", ConvexPolygonStr(bulletShape), ConvexPolygonStr(defenderShape), pR.Id, currRenderFrame.Id, delayedInputFrame.InputFrameId, obj.Data, obj.Data)) - } - } - shouldRemove = true - } - if shouldRemove { - removedBulletsAtCurrFrame[collisionBulletIndex] = 1 - } - } - - // [WARNING] Remove bullets from collisionSys ANYWAY for the convenience of rollback - for _, meleeBullet := range currRenderFrame.MeleeBullets { - collisionBulletIndex := COLLISION_BULLET_INDEX_PREFIX + meleeBullet.BattleLocalId - if bulletCollider, existent := collisionSysMap[collisionBulletIndex]; existent { - bulletCollider.Space.Remove(bulletCollider) - delete(collisionSysMap, collisionBulletIndex) - } - if _, existent := removedBulletsAtCurrFrame[collisionBulletIndex]; existent { - continue - } - nextRenderFrameMeleeBullets = append(nextRenderFrameMeleeBullets, meleeBullet) - } - - // 7. Get players out of stuck barriers if there's any - for _, player := range pR.PlayersArr { - joinIndex := player.JoinIndex - playerId := player.Id - collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex - playerCollider := collisionSysMap[collisionPlayerIndex] - // Update "virtual grid position" - currPlayerDownsync, thatPlayerInNextFrame := currRenderFrame.Players[playerId], nextRenderFramePlayers[playerId] - halfColliderWidth, halfColliderHeight := player.ColliderRadius, player.ColliderRadius+player.ColliderRadius // avoid multiplying - thatPlayerInNextFrame.VirtualGridX, thatPlayerInNextFrame.VirtualGridY = PolygonColliderBLToVirtualGridPos(playerCollider.X-effPushbacks[joinIndex-1].X, playerCollider.Y-effPushbacks[joinIndex-1].Y, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, pR.WorldToVirtualGridRatio) - - if 1 == thatPlayerInNextFrame.JoinIndex { - if currPlayerDownsync.InAir && !thatPlayerInNextFrame.InAir { - Logger.Warn(fmt.Sprintf("playerId=%d, joinIndex=%d fallStopping#2:\n{nextRenderFrame.id: %d, nextVirtualX: %d, nextVirtualY: %d, nextVelX: %d, nextVelY: %d}\n\tcalculated from <- playerColliderPos=%v, effPushback={%.3f, %.3f}", playerId, joinIndex, currRenderFrame.Id+1, thatPlayerInNextFrame.VirtualGridX, thatPlayerInNextFrame.VirtualGridY, thatPlayerInNextFrame.VelX, thatPlayerInNextFrame.VelY, RectCenterStr(playerCollider, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y)) - } else if !currPlayerDownsync.InAir && thatPlayerInNextFrame.InAir { - Logger.Warn(fmt.Sprintf("playerId=%d, joinIndex=%d took off:\n{nextRenderFrame.id: %d, nextVirtualX: %d, nextVirtualY: %d, nextVelX: %d, nextVelY: %d}\n\tcalculated from <- playerColliderPos=%v, effPushback={%.3f, %.3f}", playerId, joinIndex, currRenderFrame.Id+1, thatPlayerInNextFrame.VirtualGridX, thatPlayerInNextFrame.VirtualGridY, thatPlayerInNextFrame.VelX, thatPlayerInNextFrame.VelY, RectCenterStr(playerCollider, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y)) - } else if thatPlayerInNextFrame.InAir && (0 != thatPlayerInNextFrame.VelY) { - //Logger.Info(fmt.Sprintf("playerId=%d, joinIndex=%d inAir trajectory:\n{nextRenderFrame.id: %d, nextVirtualX: %d, nextVirtualY: %d, nextVelX: %d, nextVelY: %d}\n\tcalculated from <- playerColliderPos=%v, effPushback={%.3f, %.3f}", playerId, joinIndex, currRenderFrame.Id+1, thatPlayerInNextFrame.VirtualGridX, thatPlayerInNextFrame.VirtualGridY, thatPlayerInNextFrame.VelX, thatPlayerInNextFrame.VelY, RectCenterStr(playerCollider, halfColliderWidth, halfColliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY), effPushbacks[joinIndex-1].X, effPushbacks[joinIndex-1].Y)) - } - } - } - - return &RoomDownsyncFrame{ - Id: currRenderFrame.Id + 1, - Players: nextRenderFramePlayers, - MeleeBullets: nextRenderFrameMeleeBullets, - CountdownNanos: (pR.BattleDurationNanos - int64(currRenderFrame.Id)*pR.RollbackEstimatedDtNanos), - } -} - -func (pR *Room) decodeInput(encodedInput uint64) *InputFrameDecoded { - encodedDirection := (encodedInput & uint64(15)) - btnALevel := int32((encodedInput >> 4) & 1) - btnBLevel := int32((encodedInput >> 5) & 1) - return &InputFrameDecoded{ - Dx: DIRECTION_DECODER[encodedDirection][0], - Dy: DIRECTION_DECODER[encodedDirection][1], - BtnALevel: btnALevel, - BtnBLevel: btnBLevel, - } -} - -func (pR *Room) inputFrameIdDebuggable(inputFrameId int32) bool { - return 0 == (inputFrameId % 10) -} - func (pR *Room) refreshColliders(spaceW, spaceH int32) { // Kindly note that by now, we've already got all the shapes in the tmx file into "pR.(Players | Barriers)" from "ParseTmxLayersAndGroups" @@ -1621,21 +1242,30 @@ func (pR *Room) refreshColliders(spaceW, spaceH int32) { minStep := (int(float64(pR.PlayerDefaultSpeed)*pR.VirtualGridToWorldRatio) << 3) // the approx minimum distance a player can move per frame in world coordinate pR.Space = resolv.NewSpace(int(spaceW), int(spaceH), minStep, minStep) // allocate a new collision space everytime after a battle is settled - for _, player := range pR.Players { - wx, wy := VirtualGridToWorldPos(player.VirtualGridX, player.VirtualGridY, pR.VirtualGridToWorldRatio) + jsPlayers := toJsPlayers(pR.Players, false) + for _, player := range jsPlayers { + wx, wy := battle.VirtualGridToWorldPos(player.VirtualGridX, player.VirtualGridY, pR.VirtualGridToWorldRatio) colliderWidth, colliderHeight := player.ColliderRadius*2, player.ColliderRadius*4 - playerCollider := GenerateRectCollider(wx, wy, colliderWidth, colliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, player, "Player") // the coords of all barrier boundaries are multiples of tileWidth(i.e. 16), by adding snapping y-padding when "landedOnGravityPushback" all "playerCollider.Y" would be a multiple of 1.0 + playerCollider := battle.GenerateRectCollider(wx, wy, colliderWidth, colliderHeight, topPadding, bottomPadding, leftPadding, rightPadding, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, player, "Player") // the coords of all barrier boundaries are multiples of tileWidth(i.e. 16), by adding snapping y-padding when "landedOnGravityPushback" all "playerCollider.Y" would be a multiple of 1.0 pR.Space.Add(playerCollider) // Keep track of the collider in "pR.CollisionSysMap" joinIndex := player.JoinIndex - pR.PlayersArr[joinIndex-1] = player - collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex + collisionPlayerIndex := battle.COLLISION_PLAYER_INDEX_PREFIX + joinIndex pR.CollisionSysMap[collisionPlayerIndex] = playerCollider } - for _, barrier := range pR.Barriers { - boundaryUnaligned := barrier.Boundary - barrierCollider := GenerateConvexPolygonCollider(boundaryUnaligned, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, barrier, "Barrier") + for _, player := range pR.Players { + joinIndex := player.JoinIndex + pR.PlayersArr[joinIndex-1] = player + } + + barrierPolygon2DList := pR.TmxPolygonsMap["Barrier"] + for _, polygon2DUnaligned := range barrierPolygon2DList { + /* + // For debug-printing only. + Logger.Info("ChooseStage printing polygon2D for barrierPolygon2DList", zap.Any("barrierLocalIdInBattle", barrierLocalIdInBattle), zap.Any("polygon2D.Anchor", polygon2D.Anchor), zap.Any("polygon2D.Points", polygon2D.Points)) + */ + barrierCollider := battle.GenerateConvexPolygonCollider(polygon2DUnaligned, pR.collisionSpaceOffsetX, pR.collisionSpaceOffsetY, nil, "Barrier") pR.Space.Add(barrierCollider) } } @@ -1695,7 +1325,7 @@ func (pR *Room) doBattleMainLoopPerTickBackendDynamicsWithProperLocking(prevRend } } -func (pR *Room) downsyncToAllPlayers(inputsBufferSnapshot *InputsBufferSnapshot) { +func (pR *Room) downsyncToAllPlayers(inputsBufferSnapshot *pb.InputsBufferSnapshot) { /* [WARNING] This function MUST BE called while "pR.InputsBufferLock" is LOCKED to **preserve the order of generation of "inputsBufferSnapshot" for sending** -- see comments in "OnBattleCmdReceived" and [this issue](https://github.com/genxium/DelayNoMore/issues/12). @@ -1764,7 +1394,7 @@ func (pR *Room) downsyncToAllPlayers(inputsBufferSnapshot *InputsBufferSnapshot) } } -func (pR *Room) downsyncToSinglePlayer(playerId int32, player *Player, refRenderFrameId int32, unconfirmedMask uint64, toSendInputFrameDownsyncsSnapshot []*InputFrameDownsync, shouldForceResync bool) { +func (pR *Room) downsyncToSinglePlayer(playerId int32, player *Player, refRenderFrameId int32, unconfirmedMask uint64, toSendInputFrameDownsyncsSnapshot []*pb.InputFrameDownsync, shouldForceResync bool) { /* [WARNING] This function MUST BE called while "pR.InputsBufferLock" is unlocked -- otherwise the network I/O blocking of "sendSafely" might cause significant lag for "markConfirmationIfApplicable & forceConfirmationIfApplicable"! @@ -1796,7 +1426,7 @@ func (pR *Room) downsyncToSinglePlayer(playerId int32, player *Player, refRender panic(fmt.Sprintf("Required refRenderFrameId=%v for (roomId=%v, renderFrameId=%v, playerId=%v, playerLastSentInputFrameId=%v) doesn't exist! InputsBuffer=%v, RenderFrameBuffer=%v", refRenderFrameId, pR.Id, pR.RenderFrameId, playerId, player.LastSentInputFrameId, pR.InputsBufferString(false), pR.RenderFrameBufferString())) } - refRenderFrame := tmp.(*RoomDownsyncFrame) + refRenderFrame := tmp.(*battle.RoomDownsyncFrame) for _, player := range pR.PlayersArr { refRenderFrame.Players[player.Id].ColliderRadius = player.ColliderRadius // hardcoded for now } @@ -1818,9 +1448,9 @@ func (pR *Room) downsyncToSinglePlayer(playerId int32, player *Player, refRender } } -func (pR *Room) cloneInputsBuffer(stFrameId, edFrameId int32) []*InputFrameDownsync { +func (pR *Room) cloneInputsBuffer(stFrameId, edFrameId int32) []*pb.InputFrameDownsync { // [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked! - cloned := make([]*InputFrameDownsync, 0, edFrameId-stFrameId) + cloned := make([]*pb.InputFrameDownsync, 0, edFrameId-stFrameId) prevFrameFound := false j := stFrameId for j < edFrameId { @@ -1834,9 +1464,9 @@ func (pR *Room) cloneInputsBuffer(stFrameId, edFrameId int32) []*InputFrameDowns } } prevFrameFound = true - foo := tmp.(*InputFrameDownsync) + foo := tmp.(*pb.InputFrameDownsync) - bar := &InputFrameDownsync{ + bar := &pb.InputFrameDownsync{ InputFrameId: foo.InputFrameId, InputList: make([]uint64, len(foo.InputList)), ConfirmedList: foo.ConfirmedList, @@ -1850,29 +1480,3 @@ func (pR *Room) cloneInputsBuffer(stFrameId, edFrameId int32) []*InputFrameDowns return cloned } - -func (pR *Room) calcHardPushbacksNorms(playerCollider *resolv.Object, playerShape *resolv.ConvexPolygon, snapIntoPlatformOverlap float64, pEffPushback *Vec2D) []Vec2D { - ret := make([]Vec2D, 0, 10) // no one would simultaneously have more than 5 hardPushbacks - collision := playerCollider.Check(0, 0) - if nil == collision { - return ret - } - for _, obj := range collision.Objects { - switch obj.Data.(type) { - case *Barrier: - barrierShape := obj.Shape.(*resolv.ConvexPolygon) - overlapped, pushbackX, pushbackY, overlapResult := CalcPushbacks(0, 0, playerShape, barrierShape) - if !overlapped { - continue - } - // ALWAY snap into hardPushbacks! - // [OverlapX, OverlapY] is the unit vector that points into the platform - pushbackX, pushbackY = (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapX, (overlapResult.Overlap-snapIntoPlatformOverlap)*overlapResult.OverlapY - ret = append(ret, Vec2D{X: overlapResult.OverlapX, Y: overlapResult.OverlapY}) - pEffPushback.X += pushbackX - pEffPushback.Y += pushbackY - default: - } - } - return ret -} diff --git a/battle_srv/protos/room_downsync_frame.pb.go b/battle_srv/protos/room_downsync_frame.pb.go new file mode 100644 index 0000000..d180d59 --- /dev/null +++ b/battle_srv/protos/room_downsync_frame.pb.go @@ -0,0 +1,1797 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.4 +// source: room_downsync_frame.proto + +package protos + +import ( + _ "dnmshared/sharedprotos" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PlayerDownsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + VirtualGridX int32 `protobuf:"varint,2,opt,name=virtualGridX,proto3" json:"virtualGridX,omitempty"` + VirtualGridY int32 `protobuf:"varint,3,opt,name=virtualGridY,proto3" json:"virtualGridY,omitempty"` + DirX int32 `protobuf:"varint,4,opt,name=dirX,proto3" json:"dirX,omitempty"` + DirY int32 `protobuf:"varint,5,opt,name=dirY,proto3" json:"dirY,omitempty"` // "dirX" and "dirY" determines character facing + VelX int32 `protobuf:"varint,6,opt,name=velX,proto3" json:"velX,omitempty"` + VelY int32 `protobuf:"varint,7,opt,name=velY,proto3" json:"velY,omitempty"` // "velX" and "velY" is used to record the accumulated effect by accelerations (including gravity) + Speed int32 `protobuf:"varint,8,opt,name=speed,proto3" json:"speed,omitempty"` // this is the instantaneous scalar attribute of a character, different from but will be accounted in "velX" and "velY" + BattleState int32 `protobuf:"varint,9,opt,name=battleState,proto3" json:"battleState,omitempty"` + JoinIndex int32 `protobuf:"varint,10,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` + ColliderRadius float64 `protobuf:"fixed64,11,opt,name=colliderRadius,proto3" json:"colliderRadius,omitempty"` + Removed bool `protobuf:"varint,12,opt,name=removed,proto3" json:"removed,omitempty"` + Score int32 `protobuf:"varint,13,opt,name=score,proto3" json:"score,omitempty"` + LastMoveGmtMillis int32 `protobuf:"varint,14,opt,name=lastMoveGmtMillis,proto3" json:"lastMoveGmtMillis,omitempty"` + FramesToRecover int32 `protobuf:"varint,15,opt,name=framesToRecover,proto3" json:"framesToRecover,omitempty"` + Hp int32 `protobuf:"varint,16,opt,name=hp,proto3" json:"hp,omitempty"` + MaxHp int32 `protobuf:"varint,17,opt,name=maxHp,proto3" json:"maxHp,omitempty"` + CharacterState int32 `protobuf:"varint,18,opt,name=characterState,proto3" json:"characterState,omitempty"` + InAir bool `protobuf:"varint,19,opt,name=inAir,proto3" json:"inAir,omitempty"` // by design a standalone field only inferred by the collision result of "applyInputFrameDownsyncDynamicsOnSingleRenderFrame" instead of "characterState", because we need check the transition for "characterState" from this field, i.e. "inAir (prev -> curr)" + Name string `protobuf:"bytes,20,opt,name=name,proto3" json:"name,omitempty"` + DisplayName string `protobuf:"bytes,21,opt,name=displayName,proto3" json:"displayName,omitempty"` + Avatar string `protobuf:"bytes,22,opt,name=avatar,proto3" json:"avatar,omitempty"` +} + +func (x *PlayerDownsync) Reset() { + *x = PlayerDownsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlayerDownsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlayerDownsync) ProtoMessage() {} + +func (x *PlayerDownsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlayerDownsync.ProtoReflect.Descriptor instead. +func (*PlayerDownsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{0} +} + +func (x *PlayerDownsync) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *PlayerDownsync) GetVirtualGridX() int32 { + if x != nil { + return x.VirtualGridX + } + return 0 +} + +func (x *PlayerDownsync) GetVirtualGridY() int32 { + if x != nil { + return x.VirtualGridY + } + return 0 +} + +func (x *PlayerDownsync) GetDirX() int32 { + if x != nil { + return x.DirX + } + return 0 +} + +func (x *PlayerDownsync) GetDirY() int32 { + if x != nil { + return x.DirY + } + return 0 +} + +func (x *PlayerDownsync) GetVelX() int32 { + if x != nil { + return x.VelX + } + return 0 +} + +func (x *PlayerDownsync) GetVelY() int32 { + if x != nil { + return x.VelY + } + return 0 +} + +func (x *PlayerDownsync) GetSpeed() int32 { + if x != nil { + return x.Speed + } + return 0 +} + +func (x *PlayerDownsync) GetBattleState() int32 { + if x != nil { + return x.BattleState + } + return 0 +} + +func (x *PlayerDownsync) GetJoinIndex() int32 { + if x != nil { + return x.JoinIndex + } + return 0 +} + +func (x *PlayerDownsync) GetColliderRadius() float64 { + if x != nil { + return x.ColliderRadius + } + return 0 +} + +func (x *PlayerDownsync) GetRemoved() bool { + if x != nil { + return x.Removed + } + return false +} + +func (x *PlayerDownsync) GetScore() int32 { + if x != nil { + return x.Score + } + return 0 +} + +func (x *PlayerDownsync) GetLastMoveGmtMillis() int32 { + if x != nil { + return x.LastMoveGmtMillis + } + return 0 +} + +func (x *PlayerDownsync) GetFramesToRecover() int32 { + if x != nil { + return x.FramesToRecover + } + return 0 +} + +func (x *PlayerDownsync) GetHp() int32 { + if x != nil { + return x.Hp + } + return 0 +} + +func (x *PlayerDownsync) GetMaxHp() int32 { + if x != nil { + return x.MaxHp + } + return 0 +} + +func (x *PlayerDownsync) GetCharacterState() int32 { + if x != nil { + return x.CharacterState + } + return 0 +} + +func (x *PlayerDownsync) GetInAir() bool { + if x != nil { + return x.InAir + } + return false +} + +func (x *PlayerDownsync) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PlayerDownsync) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *PlayerDownsync) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +type InputFrameDecoded struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Dx int32 `protobuf:"varint,1,opt,name=dx,proto3" json:"dx,omitempty"` + Dy int32 `protobuf:"varint,2,opt,name=dy,proto3" json:"dy,omitempty"` + BtnALevel int32 `protobuf:"varint,3,opt,name=btnALevel,proto3" json:"btnALevel,omitempty"` + BtnBLevel int32 `protobuf:"varint,4,opt,name=btnBLevel,proto3" json:"btnBLevel,omitempty"` +} + +func (x *InputFrameDecoded) Reset() { + *x = InputFrameDecoded{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InputFrameDecoded) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputFrameDecoded) ProtoMessage() {} + +func (x *InputFrameDecoded) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InputFrameDecoded.ProtoReflect.Descriptor instead. +func (*InputFrameDecoded) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{1} +} + +func (x *InputFrameDecoded) GetDx() int32 { + if x != nil { + return x.Dx + } + return 0 +} + +func (x *InputFrameDecoded) GetDy() int32 { + if x != nil { + return x.Dy + } + return 0 +} + +func (x *InputFrameDecoded) GetBtnALevel() int32 { + if x != nil { + return x.BtnALevel + } + return 0 +} + +func (x *InputFrameDecoded) GetBtnBLevel() int32 { + if x != nil { + return x.BtnBLevel + } + return 0 +} + +type InputFrameUpsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"` + Encoded uint64 `protobuf:"varint,2,opt,name=encoded,proto3" json:"encoded,omitempty"` +} + +func (x *InputFrameUpsync) Reset() { + *x = InputFrameUpsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InputFrameUpsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputFrameUpsync) ProtoMessage() {} + +func (x *InputFrameUpsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InputFrameUpsync.ProtoReflect.Descriptor instead. +func (*InputFrameUpsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{2} +} + +func (x *InputFrameUpsync) GetInputFrameId() int32 { + if x != nil { + return x.InputFrameId + } + return 0 +} + +func (x *InputFrameUpsync) GetEncoded() uint64 { + if x != nil { + return x.Encoded + } + return 0 +} + +type InputFrameDownsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InputFrameId int32 `protobuf:"varint,1,opt,name=inputFrameId,proto3" json:"inputFrameId,omitempty"` + InputList []uint64 `protobuf:"varint,2,rep,packed,name=inputList,proto3" json:"inputList,omitempty"` // Indexed by "joinIndex", we try to compress the "single player input" into 1 word (64-bit for 64-bit Golang runtime) because atomic compare-and-swap only works on 1 word. Although CAS on custom struct is possible in Golang 1.19 https://pkg.go.dev/sync/atomic@go1.19.1#Value.CompareAndSwap, using a single word is still faster whenever possible. + ConfirmedList uint64 `protobuf:"varint,3,opt,name=confirmedList,proto3" json:"confirmedList,omitempty"` // Indexed by "joinIndex", same compression concern as above +} + +func (x *InputFrameDownsync) Reset() { + *x = InputFrameDownsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InputFrameDownsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputFrameDownsync) ProtoMessage() {} + +func (x *InputFrameDownsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InputFrameDownsync.ProtoReflect.Descriptor instead. +func (*InputFrameDownsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{3} +} + +func (x *InputFrameDownsync) GetInputFrameId() int32 { + if x != nil { + return x.InputFrameId + } + return 0 +} + +func (x *InputFrameDownsync) GetInputList() []uint64 { + if x != nil { + return x.InputList + } + return nil +} + +func (x *InputFrameDownsync) GetConfirmedList() uint64 { + if x != nil { + return x.ConfirmedList + } + return 0 +} + +type HeartbeatUpsync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientTimestamp int64 `protobuf:"varint,1,opt,name=clientTimestamp,proto3" json:"clientTimestamp,omitempty"` +} + +func (x *HeartbeatUpsync) Reset() { + *x = HeartbeatUpsync{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HeartbeatUpsync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HeartbeatUpsync) ProtoMessage() {} + +func (x *HeartbeatUpsync) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HeartbeatUpsync.ProtoReflect.Descriptor instead. +func (*HeartbeatUpsync) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{4} +} + +func (x *HeartbeatUpsync) GetClientTimestamp() int64 { + if x != nil { + return x.ClientTimestamp + } + return 0 +} + +type WsReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MsgId int32 `protobuf:"varint,1,opt,name=msgId,proto3" json:"msgId,omitempty"` + PlayerId int32 `protobuf:"varint,2,opt,name=playerId,proto3" json:"playerId,omitempty"` + Act int32 `protobuf:"varint,3,opt,name=act,proto3" json:"act,omitempty"` + JoinIndex int32 `protobuf:"varint,4,opt,name=joinIndex,proto3" json:"joinIndex,omitempty"` + AckingFrameId int32 `protobuf:"varint,5,opt,name=ackingFrameId,proto3" json:"ackingFrameId,omitempty"` + AckingInputFrameId int32 `protobuf:"varint,6,opt,name=ackingInputFrameId,proto3" json:"ackingInputFrameId,omitempty"` + InputFrameUpsyncBatch []*InputFrameUpsync `protobuf:"bytes,7,rep,name=inputFrameUpsyncBatch,proto3" json:"inputFrameUpsyncBatch,omitempty"` + Hb *HeartbeatUpsync `protobuf:"bytes,8,opt,name=hb,proto3" json:"hb,omitempty"` +} + +func (x *WsReq) Reset() { + *x = WsReq{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WsReq) ProtoMessage() {} + +func (x *WsReq) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WsReq.ProtoReflect.Descriptor instead. +func (*WsReq) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{5} +} + +func (x *WsReq) GetMsgId() int32 { + if x != nil { + return x.MsgId + } + return 0 +} + +func (x *WsReq) GetPlayerId() int32 { + if x != nil { + return x.PlayerId + } + return 0 +} + +func (x *WsReq) GetAct() int32 { + if x != nil { + return x.Act + } + return 0 +} + +func (x *WsReq) GetJoinIndex() int32 { + if x != nil { + return x.JoinIndex + } + return 0 +} + +func (x *WsReq) GetAckingFrameId() int32 { + if x != nil { + return x.AckingFrameId + } + return 0 +} + +func (x *WsReq) GetAckingInputFrameId() int32 { + if x != nil { + return x.AckingInputFrameId + } + return 0 +} + +func (x *WsReq) GetInputFrameUpsyncBatch() []*InputFrameUpsync { + if x != nil { + return x.InputFrameUpsyncBatch + } + return nil +} + +func (x *WsReq) GetHb() *HeartbeatUpsync { + if x != nil { + return x.Hb + } + return nil +} + +type WsResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Ret int32 `protobuf:"varint,1,opt,name=ret,proto3" json:"ret,omitempty"` + EchoedMsgId int32 `protobuf:"varint,2,opt,name=echoedMsgId,proto3" json:"echoedMsgId,omitempty"` + Act int32 `protobuf:"varint,3,opt,name=act,proto3" json:"act,omitempty"` + Rdf *RoomDownsyncFrame `protobuf:"bytes,4,opt,name=rdf,proto3" json:"rdf,omitempty"` + InputFrameDownsyncBatch []*InputFrameDownsync `protobuf:"bytes,5,rep,name=inputFrameDownsyncBatch,proto3" json:"inputFrameDownsyncBatch,omitempty"` + BciFrame *BattleColliderInfo `protobuf:"bytes,6,opt,name=bciFrame,proto3" json:"bciFrame,omitempty"` +} + +func (x *WsResp) Reset() { + *x = WsResp{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WsResp) ProtoMessage() {} + +func (x *WsResp) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WsResp.ProtoReflect.Descriptor instead. +func (*WsResp) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{6} +} + +func (x *WsResp) GetRet() int32 { + if x != nil { + return x.Ret + } + return 0 +} + +func (x *WsResp) GetEchoedMsgId() int32 { + if x != nil { + return x.EchoedMsgId + } + return 0 +} + +func (x *WsResp) GetAct() int32 { + if x != nil { + return x.Act + } + return 0 +} + +func (x *WsResp) GetRdf() *RoomDownsyncFrame { + if x != nil { + return x.Rdf + } + return nil +} + +func (x *WsResp) GetInputFrameDownsyncBatch() []*InputFrameDownsync { + if x != nil { + return x.InputFrameDownsyncBatch + } + return nil +} + +func (x *WsResp) GetBciFrame() *BattleColliderInfo { + if x != nil { + return x.BciFrame + } + return nil +} + +type InputsBufferSnapshot struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefRenderFrameId int32 `protobuf:"varint,1,opt,name=refRenderFrameId,proto3" json:"refRenderFrameId,omitempty"` + UnconfirmedMask uint64 `protobuf:"varint,2,opt,name=unconfirmedMask,proto3" json:"unconfirmedMask,omitempty"` + ToSendInputFrameDownsyncs []*InputFrameDownsync `protobuf:"bytes,3,rep,name=toSendInputFrameDownsyncs,proto3" json:"toSendInputFrameDownsyncs,omitempty"` + ShouldForceResync bool `protobuf:"varint,4,opt,name=shouldForceResync,proto3" json:"shouldForceResync,omitempty"` +} + +func (x *InputsBufferSnapshot) Reset() { + *x = InputsBufferSnapshot{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InputsBufferSnapshot) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InputsBufferSnapshot) ProtoMessage() {} + +func (x *InputsBufferSnapshot) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InputsBufferSnapshot.ProtoReflect.Descriptor instead. +func (*InputsBufferSnapshot) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{7} +} + +func (x *InputsBufferSnapshot) GetRefRenderFrameId() int32 { + if x != nil { + return x.RefRenderFrameId + } + return 0 +} + +func (x *InputsBufferSnapshot) GetUnconfirmedMask() uint64 { + if x != nil { + return x.UnconfirmedMask + } + return 0 +} + +func (x *InputsBufferSnapshot) GetToSendInputFrameDownsyncs() []*InputFrameDownsync { + if x != nil { + return x.ToSendInputFrameDownsyncs + } + return nil +} + +func (x *InputsBufferSnapshot) GetShouldForceResync() bool { + if x != nil { + return x.ShouldForceResync + } + return false +} + +type MeleeBullet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // for offender + BattleLocalId int32 `protobuf:"varint,1,opt,name=battleLocalId,proto3" json:"battleLocalId,omitempty"` + StartupFrames int32 `protobuf:"varint,2,opt,name=startupFrames,proto3" json:"startupFrames,omitempty"` + ActiveFrames int32 `protobuf:"varint,3,opt,name=activeFrames,proto3" json:"activeFrames,omitempty"` + RecoveryFrames int32 `protobuf:"varint,4,opt,name=recoveryFrames,proto3" json:"recoveryFrames,omitempty"` + RecoveryFramesOnBlock int32 `protobuf:"varint,5,opt,name=recoveryFramesOnBlock,proto3" json:"recoveryFramesOnBlock,omitempty"` + RecoveryFramesOnHit int32 `protobuf:"varint,6,opt,name=recoveryFramesOnHit,proto3" json:"recoveryFramesOnHit,omitempty"` + HitboxOffset float64 `protobuf:"fixed64,7,opt,name=hitboxOffset,proto3" json:"hitboxOffset,omitempty"` + OriginatedRenderFrameId int32 `protobuf:"varint,8,opt,name=originatedRenderFrameId,proto3" json:"originatedRenderFrameId,omitempty"` + // for defender + HitStunFrames int32 `protobuf:"varint,9,opt,name=hitStunFrames,proto3" json:"hitStunFrames,omitempty"` + BlockStunFrames int32 `protobuf:"varint,10,opt,name=blockStunFrames,proto3" json:"blockStunFrames,omitempty"` + Pushback float64 `protobuf:"fixed64,11,opt,name=pushback,proto3" json:"pushback,omitempty"` + ReleaseTriggerType int32 `protobuf:"varint,12,opt,name=releaseTriggerType,proto3" json:"releaseTriggerType,omitempty"` // 1: rising-edge, 2: falling-edge + Damage int32 `protobuf:"varint,13,opt,name=damage,proto3" json:"damage,omitempty"` + OffenderJoinIndex int32 `protobuf:"varint,14,opt,name=offenderJoinIndex,proto3" json:"offenderJoinIndex,omitempty"` + OffenderPlayerId int32 `protobuf:"varint,15,opt,name=offenderPlayerId,proto3" json:"offenderPlayerId,omitempty"` + HitboxSizeX float64 `protobuf:"fixed64,16,opt,name=hitboxSizeX,proto3" json:"hitboxSizeX,omitempty"` + HitboxSizeY float64 `protobuf:"fixed64,17,opt,name=hitboxSizeY,proto3" json:"hitboxSizeY,omitempty"` + SelfMoveforwardX float64 `protobuf:"fixed64,18,opt,name=selfMoveforwardX,proto3" json:"selfMoveforwardX,omitempty"` + SelfMoveforwardY float64 `protobuf:"fixed64,19,opt,name=selfMoveforwardY,proto3" json:"selfMoveforwardY,omitempty"` +} + +func (x *MeleeBullet) Reset() { + *x = MeleeBullet{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MeleeBullet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MeleeBullet) ProtoMessage() {} + +func (x *MeleeBullet) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MeleeBullet.ProtoReflect.Descriptor instead. +func (*MeleeBullet) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{8} +} + +func (x *MeleeBullet) GetBattleLocalId() int32 { + if x != nil { + return x.BattleLocalId + } + return 0 +} + +func (x *MeleeBullet) GetStartupFrames() int32 { + if x != nil { + return x.StartupFrames + } + return 0 +} + +func (x *MeleeBullet) GetActiveFrames() int32 { + if x != nil { + return x.ActiveFrames + } + return 0 +} + +func (x *MeleeBullet) GetRecoveryFrames() int32 { + if x != nil { + return x.RecoveryFrames + } + return 0 +} + +func (x *MeleeBullet) GetRecoveryFramesOnBlock() int32 { + if x != nil { + return x.RecoveryFramesOnBlock + } + return 0 +} + +func (x *MeleeBullet) GetRecoveryFramesOnHit() int32 { + if x != nil { + return x.RecoveryFramesOnHit + } + return 0 +} + +func (x *MeleeBullet) GetHitboxOffset() float64 { + if x != nil { + return x.HitboxOffset + } + return 0 +} + +func (x *MeleeBullet) GetOriginatedRenderFrameId() int32 { + if x != nil { + return x.OriginatedRenderFrameId + } + return 0 +} + +func (x *MeleeBullet) GetHitStunFrames() int32 { + if x != nil { + return x.HitStunFrames + } + return 0 +} + +func (x *MeleeBullet) GetBlockStunFrames() int32 { + if x != nil { + return x.BlockStunFrames + } + return 0 +} + +func (x *MeleeBullet) GetPushback() float64 { + if x != nil { + return x.Pushback + } + return 0 +} + +func (x *MeleeBullet) GetReleaseTriggerType() int32 { + if x != nil { + return x.ReleaseTriggerType + } + return 0 +} + +func (x *MeleeBullet) GetDamage() int32 { + if x != nil { + return x.Damage + } + return 0 +} + +func (x *MeleeBullet) GetOffenderJoinIndex() int32 { + if x != nil { + return x.OffenderJoinIndex + } + return 0 +} + +func (x *MeleeBullet) GetOffenderPlayerId() int32 { + if x != nil { + return x.OffenderPlayerId + } + return 0 +} + +func (x *MeleeBullet) GetHitboxSizeX() float64 { + if x != nil { + return x.HitboxSizeX + } + return 0 +} + +func (x *MeleeBullet) GetHitboxSizeY() float64 { + if x != nil { + return x.HitboxSizeY + } + return 0 +} + +func (x *MeleeBullet) GetSelfMoveforwardX() float64 { + if x != nil { + return x.SelfMoveforwardX + } + return 0 +} + +func (x *MeleeBullet) GetSelfMoveforwardY() float64 { + if x != nil { + return x.SelfMoveforwardY + } + return 0 +} + +type BattleColliderInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StageName string `protobuf:"bytes,1,opt,name=stageName,proto3" json:"stageName,omitempty"` + StageDiscreteW int32 `protobuf:"varint,2,opt,name=stageDiscreteW,proto3" json:"stageDiscreteW,omitempty"` + StageDiscreteH int32 `protobuf:"varint,3,opt,name=stageDiscreteH,proto3" json:"stageDiscreteH,omitempty"` + StageTileW int32 `protobuf:"varint,4,opt,name=stageTileW,proto3" json:"stageTileW,omitempty"` + StageTileH int32 `protobuf:"varint,5,opt,name=stageTileH,proto3" json:"stageTileH,omitempty"` + IntervalToPing int32 `protobuf:"varint,6,opt,name=intervalToPing,proto3" json:"intervalToPing,omitempty"` + WillKickIfInactiveFor int32 `protobuf:"varint,7,opt,name=willKickIfInactiveFor,proto3" json:"willKickIfInactiveFor,omitempty"` + BoundRoomId int32 `protobuf:"varint,8,opt,name=boundRoomId,proto3" json:"boundRoomId,omitempty"` + BattleDurationFrames int32 `protobuf:"varint,9,opt,name=battleDurationFrames,proto3" json:"battleDurationFrames,omitempty"` + BattleDurationNanos int64 `protobuf:"varint,10,opt,name=battleDurationNanos,proto3" json:"battleDurationNanos,omitempty"` + ServerFps int32 `protobuf:"varint,11,opt,name=serverFps,proto3" json:"serverFps,omitempty"` + InputDelayFrames int32 `protobuf:"varint,12,opt,name=inputDelayFrames,proto3" json:"inputDelayFrames,omitempty"` // in the count of render frames + InputScaleFrames uint32 `protobuf:"varint,13,opt,name=inputScaleFrames,proto3" json:"inputScaleFrames,omitempty"` // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) + NstDelayFrames int32 `protobuf:"varint,14,opt,name=nstDelayFrames,proto3" json:"nstDelayFrames,omitempty"` // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames" + InputFrameUpsyncDelayTolerance int32 `protobuf:"varint,15,opt,name=inputFrameUpsyncDelayTolerance,proto3" json:"inputFrameUpsyncDelayTolerance,omitempty"` + MaxChasingRenderFramesPerUpdate int32 `protobuf:"varint,16,opt,name=maxChasingRenderFramesPerUpdate,proto3" json:"maxChasingRenderFramesPerUpdate,omitempty"` + PlayerBattleState int32 `protobuf:"varint,17,opt,name=playerBattleState,proto3" json:"playerBattleState,omitempty"` + RollbackEstimatedDtMillis float64 `protobuf:"fixed64,18,opt,name=rollbackEstimatedDtMillis,proto3" json:"rollbackEstimatedDtMillis,omitempty"` + RollbackEstimatedDtNanos int64 `protobuf:"varint,19,opt,name=rollbackEstimatedDtNanos,proto3" json:"rollbackEstimatedDtNanos,omitempty"` + WorldToVirtualGridRatio float64 `protobuf:"fixed64,20,opt,name=worldToVirtualGridRatio,proto3" json:"worldToVirtualGridRatio,omitempty"` + VirtualGridToWorldRatio float64 `protobuf:"fixed64,21,opt,name=virtualGridToWorldRatio,proto3" json:"virtualGridToWorldRatio,omitempty"` + SpAtkLookupFrames int32 `protobuf:"varint,22,opt,name=spAtkLookupFrames,proto3" json:"spAtkLookupFrames,omitempty"` + RenderCacheSize int32 `protobuf:"varint,23,opt,name=renderCacheSize,proto3" json:"renderCacheSize,omitempty"` + MeleeSkillConfig map[int32]*MeleeBullet `protobuf:"bytes,24,rep,name=meleeSkillConfig,proto3" json:"meleeSkillConfig,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // skillId -> skill + SnapIntoPlatformOverlap float64 `protobuf:"fixed64,25,opt,name=snapIntoPlatformOverlap,proto3" json:"snapIntoPlatformOverlap,omitempty"` + SnapIntoPlatformThreshold float64 `protobuf:"fixed64,26,opt,name=snapIntoPlatformThreshold,proto3" json:"snapIntoPlatformThreshold,omitempty"` + JumpingInitVelY int32 `protobuf:"varint,27,opt,name=jumpingInitVelY,proto3" json:"jumpingInitVelY,omitempty"` + GravityX int32 `protobuf:"varint,28,opt,name=gravityX,proto3" json:"gravityX,omitempty"` + GravityY int32 `protobuf:"varint,29,opt,name=gravityY,proto3" json:"gravityY,omitempty"` +} + +func (x *BattleColliderInfo) Reset() { + *x = BattleColliderInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BattleColliderInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BattleColliderInfo) ProtoMessage() {} + +func (x *BattleColliderInfo) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BattleColliderInfo.ProtoReflect.Descriptor instead. +func (*BattleColliderInfo) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{9} +} + +func (x *BattleColliderInfo) GetStageName() string { + if x != nil { + return x.StageName + } + return "" +} + +func (x *BattleColliderInfo) GetStageDiscreteW() int32 { + if x != nil { + return x.StageDiscreteW + } + return 0 +} + +func (x *BattleColliderInfo) GetStageDiscreteH() int32 { + if x != nil { + return x.StageDiscreteH + } + return 0 +} + +func (x *BattleColliderInfo) GetStageTileW() int32 { + if x != nil { + return x.StageTileW + } + return 0 +} + +func (x *BattleColliderInfo) GetStageTileH() int32 { + if x != nil { + return x.StageTileH + } + return 0 +} + +func (x *BattleColliderInfo) GetIntervalToPing() int32 { + if x != nil { + return x.IntervalToPing + } + return 0 +} + +func (x *BattleColliderInfo) GetWillKickIfInactiveFor() int32 { + if x != nil { + return x.WillKickIfInactiveFor + } + return 0 +} + +func (x *BattleColliderInfo) GetBoundRoomId() int32 { + if x != nil { + return x.BoundRoomId + } + return 0 +} + +func (x *BattleColliderInfo) GetBattleDurationFrames() int32 { + if x != nil { + return x.BattleDurationFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetBattleDurationNanos() int64 { + if x != nil { + return x.BattleDurationNanos + } + return 0 +} + +func (x *BattleColliderInfo) GetServerFps() int32 { + if x != nil { + return x.ServerFps + } + return 0 +} + +func (x *BattleColliderInfo) GetInputDelayFrames() int32 { + if x != nil { + return x.InputDelayFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetInputScaleFrames() uint32 { + if x != nil { + return x.InputScaleFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetNstDelayFrames() int32 { + if x != nil { + return x.NstDelayFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetInputFrameUpsyncDelayTolerance() int32 { + if x != nil { + return x.InputFrameUpsyncDelayTolerance + } + return 0 +} + +func (x *BattleColliderInfo) GetMaxChasingRenderFramesPerUpdate() int32 { + if x != nil { + return x.MaxChasingRenderFramesPerUpdate + } + return 0 +} + +func (x *BattleColliderInfo) GetPlayerBattleState() int32 { + if x != nil { + return x.PlayerBattleState + } + return 0 +} + +func (x *BattleColliderInfo) GetRollbackEstimatedDtMillis() float64 { + if x != nil { + return x.RollbackEstimatedDtMillis + } + return 0 +} + +func (x *BattleColliderInfo) GetRollbackEstimatedDtNanos() int64 { + if x != nil { + return x.RollbackEstimatedDtNanos + } + return 0 +} + +func (x *BattleColliderInfo) GetWorldToVirtualGridRatio() float64 { + if x != nil { + return x.WorldToVirtualGridRatio + } + return 0 +} + +func (x *BattleColliderInfo) GetVirtualGridToWorldRatio() float64 { + if x != nil { + return x.VirtualGridToWorldRatio + } + return 0 +} + +func (x *BattleColliderInfo) GetSpAtkLookupFrames() int32 { + if x != nil { + return x.SpAtkLookupFrames + } + return 0 +} + +func (x *BattleColliderInfo) GetRenderCacheSize() int32 { + if x != nil { + return x.RenderCacheSize + } + return 0 +} + +func (x *BattleColliderInfo) GetMeleeSkillConfig() map[int32]*MeleeBullet { + if x != nil { + return x.MeleeSkillConfig + } + return nil +} + +func (x *BattleColliderInfo) GetSnapIntoPlatformOverlap() float64 { + if x != nil { + return x.SnapIntoPlatformOverlap + } + return 0 +} + +func (x *BattleColliderInfo) GetSnapIntoPlatformThreshold() float64 { + if x != nil { + return x.SnapIntoPlatformThreshold + } + return 0 +} + +func (x *BattleColliderInfo) GetJumpingInitVelY() int32 { + if x != nil { + return x.JumpingInitVelY + } + return 0 +} + +func (x *BattleColliderInfo) GetGravityX() int32 { + if x != nil { + return x.GravityX + } + return 0 +} + +func (x *BattleColliderInfo) GetGravityY() int32 { + if x != nil { + return x.GravityY + } + return 0 +} + +type RoomDownsyncFrame struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + PlayersArr []*PlayerDownsync `protobuf:"bytes,2,rep,name=playersArr,proto3" json:"playersArr,omitempty"` + CountdownNanos int64 `protobuf:"varint,3,opt,name=countdownNanos,proto3" json:"countdownNanos,omitempty"` + MeleeBullets []*MeleeBullet `protobuf:"bytes,4,rep,name=meleeBullets,proto3" json:"meleeBullets,omitempty"` // I don't know how to mimic inheritance/composition in protobuf by far, thus using an array for each type of bullet as a compromise + BackendUnconfirmedMask uint64 `protobuf:"varint,5,opt,name=backendUnconfirmedMask,proto3" json:"backendUnconfirmedMask,omitempty"` // Indexed by "joinIndex", same compression concern as stated in InputFrameDownsync + ShouldForceResync bool `protobuf:"varint,6,opt,name=shouldForceResync,proto3" json:"shouldForceResync,omitempty"` + Players map[int32]*PlayerDownsync `protobuf:"bytes,99,rep,name=players,proto3" json:"players,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // TO BE DEPRECATED +} + +func (x *RoomDownsyncFrame) Reset() { + *x = RoomDownsyncFrame{} + if protoimpl.UnsafeEnabled { + mi := &file_room_downsync_frame_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoomDownsyncFrame) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoomDownsyncFrame) ProtoMessage() {} + +func (x *RoomDownsyncFrame) ProtoReflect() protoreflect.Message { + mi := &file_room_downsync_frame_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoomDownsyncFrame.ProtoReflect.Descriptor instead. +func (*RoomDownsyncFrame) Descriptor() ([]byte, []int) { + return file_room_downsync_frame_proto_rawDescGZIP(), []int{10} +} + +func (x *RoomDownsyncFrame) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RoomDownsyncFrame) GetPlayersArr() []*PlayerDownsync { + if x != nil { + return x.PlayersArr + } + return nil +} + +func (x *RoomDownsyncFrame) GetCountdownNanos() int64 { + if x != nil { + return x.CountdownNanos + } + return 0 +} + +func (x *RoomDownsyncFrame) GetMeleeBullets() []*MeleeBullet { + if x != nil { + return x.MeleeBullets + } + return nil +} + +func (x *RoomDownsyncFrame) GetBackendUnconfirmedMask() uint64 { + if x != nil { + return x.BackendUnconfirmedMask + } + return 0 +} + +func (x *RoomDownsyncFrame) GetShouldForceResync() bool { + if x != nil { + return x.ShouldForceResync + } + return false +} + +func (x *RoomDownsyncFrame) GetPlayers() map[int32]*PlayerDownsync { + if x != nil { + return x.Players + } + return nil +} + +var File_room_downsync_frame_proto protoreflect.FileDescriptor + +var file_room_downsync_frame_proto_rawDesc = []byte{ + 0x0a, 0x19, 0x72, 0x6f, 0x6f, 0x6d, 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x5f, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x1a, 0x0e, 0x67, 0x65, 0x6f, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xf0, 0x04, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, + 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, + 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x76, 0x69, + 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x58, 0x12, 0x22, 0x0a, 0x0c, 0x76, 0x69, + 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x59, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x59, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x69, 0x72, 0x58, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x64, 0x69, + 0x72, 0x58, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x69, 0x72, 0x59, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x64, 0x69, 0x72, 0x59, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x65, 0x6c, 0x58, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x76, 0x65, 0x6c, 0x58, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x65, + 0x6c, 0x59, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x76, 0x65, 0x6c, 0x59, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, + 0x70, 0x65, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0e, 0x63, 0x6f, + 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x2c, 0x0a, 0x11, + 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, + 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x76, + 0x65, 0x47, 0x6d, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x66, 0x72, + 0x61, 0x6d, 0x65, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x68, 0x70, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x02, 0x68, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x78, 0x48, 0x70, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, 0x61, 0x78, 0x48, 0x70, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x68, + 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0e, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x41, 0x69, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x05, 0x69, 0x6e, 0x41, 0x69, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x15, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x6f, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, + 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x78, 0x12, 0x0e, 0x0a, 0x02, 0x64, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x62, + 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, + 0x62, 0x74, 0x6e, 0x41, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x74, 0x6e, + 0x42, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x62, 0x74, + 0x6e, 0x42, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x50, 0x0a, 0x10, 0x49, 0x6e, 0x70, 0x75, 0x74, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22, 0x7c, 0x0a, 0x12, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x12, + 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x04, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4c, 0x69, + 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x65, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x0f, 0x48, 0x65, 0x61, 0x72, 0x74, + 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x28, 0x0a, 0x0f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x22, 0xb8, 0x02, 0x0a, 0x05, 0x57, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, + 0x0a, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6d, + 0x73, 0x67, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, + 0x63, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x6a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x12, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, + 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, + 0x15, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, + 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x27, 0x0a, 0x02, 0x68, 0x62, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x62, 0x65, 0x61, 0x74, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x02, 0x68, 0x62, 0x22, + 0x89, 0x02, 0x0a, 0x06, 0x57, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x65, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x72, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x0b, + 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x65, 0x63, 0x68, 0x6f, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x10, + 0x0a, 0x03, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x63, 0x74, + 0x12, 0x2b, 0x0a, 0x03, 0x72, 0x64, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x03, 0x72, 0x64, 0x66, 0x12, 0x54, 0x0a, + 0x17, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x79, 0x6e, 0x63, 0x42, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x17, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x12, 0x36, 0x0a, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x08, 0x62, 0x63, 0x69, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x22, 0xf4, 0x01, 0x0a, 0x14, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, 0x66, 0x52, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, + 0x72, 0x65, 0x66, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, + 0x12, 0x28, 0x0a, 0x0f, 0x75, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x75, 0x6e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x58, 0x0a, 0x19, 0x74, 0x6f, + 0x53, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, + 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x19, 0x74, 0x6f, 0x53, 0x65, 0x6e, + 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x44, 0x6f, 0x77, 0x6e, 0x73, + 0x79, 0x6e, 0x63, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, + 0x6e, 0x63, 0x22, 0x95, 0x06, 0x0a, 0x0b, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, + 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x4c, 0x6f, 0x63, 0x61, + 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x62, 0x61, 0x74, 0x74, 0x6c, + 0x65, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x72, + 0x74, 0x75, 0x70, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0d, 0x73, 0x74, 0x61, 0x72, 0x74, 0x75, 0x70, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x22, + 0x0a, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x65, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x15, 0x72, 0x65, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x4f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x72, 0x65, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x4f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x12, 0x30, 0x0a, 0x13, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x73, 0x4f, 0x6e, 0x48, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x72, + 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x4f, 0x6e, 0x48, + 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x68, 0x69, 0x74, 0x62, 0x6f, 0x78, 0x4f, 0x66, 0x66, 0x73, + 0x65, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0c, 0x68, 0x69, 0x74, 0x62, 0x6f, 0x78, + 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x38, 0x0a, 0x17, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x17, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x49, 0x64, + 0x12, 0x24, 0x0a, 0x0d, 0x68, 0x69, 0x74, 0x53, 0x74, 0x75, 0x6e, 0x46, 0x72, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x68, 0x69, 0x74, 0x53, 0x74, 0x75, 0x6e, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, + 0x74, 0x75, 0x6e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x74, 0x75, 0x6e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x75, 0x73, 0x68, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x08, 0x70, 0x75, 0x73, 0x68, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x2e, 0x0a, 0x12, + 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, + 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, + 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x64, 0x61, + 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x6f, 0x66, 0x66, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x4a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x11, 0x6f, 0x66, 0x66, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4a, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x12, 0x2a, 0x0a, 0x10, 0x6f, 0x66, 0x66, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x6c, + 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x6f, 0x66, + 0x66, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, + 0x0a, 0x0b, 0x68, 0x69, 0x74, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x58, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, 0x69, 0x74, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x58, + 0x12, 0x20, 0x0a, 0x0b, 0x68, 0x69, 0x74, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x65, 0x59, 0x18, + 0x11, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x68, 0x69, 0x74, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, + 0x65, 0x59, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, + 0x72, 0x77, 0x61, 0x72, 0x64, 0x58, 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x65, + 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x58, 0x12, 0x2a, + 0x0a, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, + 0x64, 0x59, 0x18, 0x13, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x73, 0x65, 0x6c, 0x66, 0x4d, 0x6f, + 0x76, 0x65, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x59, 0x22, 0xde, 0x0b, 0x0a, 0x12, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x26, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, + 0x57, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, + 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x57, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, + 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x48, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0e, 0x73, 0x74, 0x61, 0x67, 0x65, 0x44, 0x69, 0x73, 0x63, 0x72, 0x65, 0x74, 0x65, 0x48, 0x12, + 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6c, 0x65, 0x57, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6c, 0x65, 0x57, 0x12, + 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6c, 0x65, 0x48, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x67, 0x65, 0x54, 0x69, 0x6c, 0x65, 0x48, 0x12, + 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x54, 0x6f, 0x50, 0x69, 0x6e, + 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x54, 0x6f, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x15, 0x77, 0x69, 0x6c, 0x6c, 0x4b, + 0x69, 0x63, 0x6b, 0x49, 0x66, 0x49, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x46, 0x6f, 0x72, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x15, 0x77, 0x69, 0x6c, 0x6c, 0x4b, 0x69, 0x63, 0x6b, + 0x49, 0x66, 0x49, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x46, 0x6f, 0x72, 0x12, 0x20, 0x0a, + 0x0b, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0b, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, + 0x32, 0x0a, 0x14, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x62, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x13, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x46, + 0x70, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x46, 0x70, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x65, 0x6c, 0x61, + 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x69, + 0x6e, 0x70, 0x75, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, + 0x2a, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, + 0x53, 0x63, 0x61, 0x6c, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0e, 0x6e, + 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6e, 0x73, 0x74, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x1e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x54, 0x6f, 0x6c, 0x65, + 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x1e, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x55, 0x70, 0x73, 0x79, 0x6e, 0x63, 0x44, 0x65, 0x6c, + 0x61, 0x79, 0x54, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x1f, 0x6d, + 0x61, 0x78, 0x43, 0x68, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, + 0x72, 0x61, 0x6d, 0x65, 0x73, 0x50, 0x65, 0x72, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x1f, 0x6d, 0x61, 0x78, 0x43, 0x68, 0x61, 0x73, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x50, 0x65, 0x72, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, + 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x11, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x42, 0x61, 0x74, 0x74, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x19, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x45, + 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, + 0x18, 0x12, 0x20, 0x01, 0x28, 0x01, 0x52, 0x19, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, + 0x73, 0x12, 0x3a, 0x0a, 0x18, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x45, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x13, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x18, 0x72, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x45, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x12, 0x38, 0x0a, + 0x17, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x54, 0x6f, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, + 0x72, 0x69, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x14, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, + 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x54, 0x6f, 0x56, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x47, 0x72, + 0x69, 0x64, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x38, 0x0a, 0x17, 0x76, 0x69, 0x72, 0x74, 0x75, + 0x61, 0x6c, 0x47, 0x72, 0x69, 0x64, 0x54, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x52, 0x61, 0x74, + 0x69, 0x6f, 0x18, 0x15, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, + 0x6c, 0x47, 0x72, 0x69, 0x64, 0x54, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x52, 0x61, 0x74, 0x69, + 0x6f, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x70, 0x41, 0x74, 0x6b, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x73, 0x70, + 0x41, 0x74, 0x6b, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, + 0x28, 0x0a, 0x0f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x43, 0x61, 0x63, 0x68, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x5c, 0x0a, 0x10, 0x6d, 0x65, 0x6c, + 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x18, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x74, + 0x74, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, + 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x17, 0x73, 0x6e, 0x61, 0x70, 0x49, + 0x6e, 0x74, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x76, 0x65, 0x72, 0x6c, + 0x61, 0x70, 0x18, 0x19, 0x20, 0x01, 0x28, 0x01, 0x52, 0x17, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, + 0x74, 0x6f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4f, 0x76, 0x65, 0x72, 0x6c, 0x61, + 0x70, 0x12, 0x3c, 0x0a, 0x19, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x50, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x1a, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x19, 0x73, 0x6e, 0x61, 0x70, 0x49, 0x6e, 0x74, 0x6f, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, + 0x28, 0x0a, 0x0f, 0x6a, 0x75, 0x6d, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x69, 0x74, 0x56, 0x65, + 0x6c, 0x59, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x6a, 0x75, 0x6d, 0x70, 0x69, 0x6e, + 0x67, 0x49, 0x6e, 0x69, 0x74, 0x56, 0x65, 0x6c, 0x59, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x61, + 0x76, 0x69, 0x74, 0x79, 0x58, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x61, + 0x76, 0x69, 0x74, 0x79, 0x58, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, + 0x59, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x79, + 0x59, 0x1a, 0x58, 0x0a, 0x15, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb8, 0x03, 0x0a, 0x11, + 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x0a, 0x70, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x41, 0x72, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x4e, 0x61, 0x6e, 0x6f, + 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x6d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x4d, 0x65, 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x0c, 0x6d, 0x65, + 0x6c, 0x65, 0x65, 0x42, 0x75, 0x6c, 0x6c, 0x65, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x16, 0x62, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x61, 0x63, 0x6b, + 0x65, 0x6e, 0x64, 0x55, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x4d, 0x61, + 0x73, 0x6b, 0x12, 0x2c, 0x0a, 0x11, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, + 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x73, + 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x79, 0x6e, 0x63, + 0x12, 0x40, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x63, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x44, + 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x73, 0x1a, 0x52, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x79, 0x6e, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x13, 0x5a, 0x11, 0x62, 0x61, 0x74, 0x74, 0x6c, 0x65, + 0x5f, 0x73, 0x72, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_room_downsync_frame_proto_rawDescOnce sync.Once + file_room_downsync_frame_proto_rawDescData = file_room_downsync_frame_proto_rawDesc +) + +func file_room_downsync_frame_proto_rawDescGZIP() []byte { + file_room_downsync_frame_proto_rawDescOnce.Do(func() { + file_room_downsync_frame_proto_rawDescData = protoimpl.X.CompressGZIP(file_room_downsync_frame_proto_rawDescData) + }) + return file_room_downsync_frame_proto_rawDescData +} + +var file_room_downsync_frame_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_room_downsync_frame_proto_goTypes = []interface{}{ + (*PlayerDownsync)(nil), // 0: protos.PlayerDownsync + (*InputFrameDecoded)(nil), // 1: protos.InputFrameDecoded + (*InputFrameUpsync)(nil), // 2: protos.InputFrameUpsync + (*InputFrameDownsync)(nil), // 3: protos.InputFrameDownsync + (*HeartbeatUpsync)(nil), // 4: protos.HeartbeatUpsync + (*WsReq)(nil), // 5: protos.WsReq + (*WsResp)(nil), // 6: protos.WsResp + (*InputsBufferSnapshot)(nil), // 7: protos.InputsBufferSnapshot + (*MeleeBullet)(nil), // 8: protos.MeleeBullet + (*BattleColliderInfo)(nil), // 9: protos.BattleColliderInfo + (*RoomDownsyncFrame)(nil), // 10: protos.RoomDownsyncFrame + nil, // 11: protos.BattleColliderInfo.MeleeSkillConfigEntry + nil, // 12: protos.RoomDownsyncFrame.PlayersEntry +} +var file_room_downsync_frame_proto_depIdxs = []int32{ + 2, // 0: protos.WsReq.inputFrameUpsyncBatch:type_name -> protos.InputFrameUpsync + 4, // 1: protos.WsReq.hb:type_name -> protos.HeartbeatUpsync + 10, // 2: protos.WsResp.rdf:type_name -> protos.RoomDownsyncFrame + 3, // 3: protos.WsResp.inputFrameDownsyncBatch:type_name -> protos.InputFrameDownsync + 9, // 4: protos.WsResp.bciFrame:type_name -> protos.BattleColliderInfo + 3, // 5: protos.InputsBufferSnapshot.toSendInputFrameDownsyncs:type_name -> protos.InputFrameDownsync + 11, // 6: protos.BattleColliderInfo.meleeSkillConfig:type_name -> protos.BattleColliderInfo.MeleeSkillConfigEntry + 0, // 7: protos.RoomDownsyncFrame.playersArr:type_name -> protos.PlayerDownsync + 8, // 8: protos.RoomDownsyncFrame.meleeBullets:type_name -> protos.MeleeBullet + 12, // 9: protos.RoomDownsyncFrame.players:type_name -> protos.RoomDownsyncFrame.PlayersEntry + 8, // 10: protos.BattleColliderInfo.MeleeSkillConfigEntry.value:type_name -> protos.MeleeBullet + 0, // 11: protos.RoomDownsyncFrame.PlayersEntry.value:type_name -> protos.PlayerDownsync + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_room_downsync_frame_proto_init() } +func file_room_downsync_frame_proto_init() { + if File_room_downsync_frame_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_room_downsync_frame_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlayerDownsync); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InputFrameDecoded); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InputFrameUpsync); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InputFrameDownsync); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HeartbeatUpsync); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WsReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WsResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InputsBufferSnapshot); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MeleeBullet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BattleColliderInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_room_downsync_frame_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoomDownsyncFrame); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_room_downsync_frame_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_room_downsync_frame_proto_goTypes, + DependencyIndexes: file_room_downsync_frame_proto_depIdxs, + MessageInfos: file_room_downsync_frame_proto_msgTypes, + }.Build() + File_room_downsync_frame_proto = out.File + file_room_downsync_frame_proto_rawDesc = nil + file_room_downsync_frame_proto_goTypes = nil + file_room_downsync_frame_proto_depIdxs = nil +} diff --git a/battle_srv/ws/serve.go b/battle_srv/ws/serve.go index 627d014..8299428 100644 --- a/battle_srv/ws/serve.go +++ b/battle_srv/ws/serve.go @@ -3,7 +3,7 @@ package ws import ( . "battle_srv/common" "battle_srv/models" - pb "jsexport/protos" + pb "battle_srv/protos" "container/heap" "fmt" "github.com/gin-gonic/gin" diff --git a/dnmshared/geometry.go b/dnmshared/geometry.go deleted file mode 100644 index 1b8e4c8..0000000 --- a/dnmshared/geometry.go +++ /dev/null @@ -1,50 +0,0 @@ -package dnmshared - -import ( - . "dnmshared/sharedprotos" - "math" -) - -func NormVec2D(dx, dy float64) Vec2D { - return Vec2D{X: dy, Y: -dx} -} - -func AlignPolygon2DToBoundingBox(input *Polygon2D) *Polygon2D { - // Transform again to put "anchor" at the "bottom-left point (w.r.t. world space)" of the bounding box for "resolv" - boundingBoxBL := &Vec2D{ - X: math.MaxFloat64, - Y: math.MaxFloat64, - } - for _, p := range input.Points { - if p.X < boundingBoxBL.X { - boundingBoxBL.X = p.X - } - if p.Y < boundingBoxBL.Y { - boundingBoxBL.Y = p.Y - } - } - - // Now "input.Anchor" should move to "input.Anchor+boundingBoxBL", thus "boundingBoxBL" is also the value of the negative diff for all "input.Points" - output := &Polygon2D{ - Anchor: &Vec2D{ - X: input.Anchor.X + boundingBoxBL.X, - Y: input.Anchor.Y + boundingBoxBL.Y, - }, - Points: make([]*Vec2D, len(input.Points)), - } - - for i, p := range input.Points { - output.Points[i] = &Vec2D{ - X: p.X - boundingBoxBL.X, - Y: p.Y - boundingBoxBL.Y, - } - } - - return output -} - -func Distance(pt1 *Vec2D, pt2 *Vec2D) float64 { - dx := pt1.X - pt2.X - dy := pt1.Y - pt2.Y - return math.Sqrt(dx*dx + dy*dy) -} diff --git a/dnmshared/resolv_helper.go b/dnmshared/resolv_helper.go index 1aff986..7faeb7c 100644 --- a/dnmshared/resolv_helper.go +++ b/dnmshared/resolv_helper.go @@ -1,14 +1,16 @@ package dnmshared import ( - . "dnmshared/sharedprotos" + . "jsexport/battle" "fmt" - "github.com/kvartborg/vector" "github.com/solarlune/resolv" - "math" "strings" ) +func NormVec2D(dx, dy float64) Vec2D { + return Vec2D{X: dy, Y: -dx} +} + func ConvexPolygonStr(body *resolv.ConvexPolygon) string { var s []string = make([]string, len(body.Points)) for i, p := range body.Points { @@ -21,251 +23,3 @@ func ConvexPolygonStr(body *resolv.ConvexPolygon) string { func RectCenterStr(body *resolv.Object, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, spaceOffsetX, spaceOffsetY float64) string { return fmt.Sprintf("{%.2f, %.2f}", body.X+leftPadding+halfBoundingW-spaceOffsetX, body.Y+bottomPadding+halfBoundingH-spaceOffsetY) } - -func GenerateRectCollider(wx, wy, w, h, topPadding, bottomPadding, leftPadding, rightPadding, spaceOffsetX, spaceOffsetY float64, data interface{}, tag string) *resolv.Object { - blX, blY := WorldToPolygonColliderBLPos(wx, wy, w*0.5, h*0.5, topPadding, bottomPadding, leftPadding, rightPadding, spaceOffsetX, spaceOffsetY) - return generateRectColliderInCollisionSpace(blX, blY, leftPadding+w+rightPadding, bottomPadding+h+topPadding, data, tag) -} - -func generateRectColliderInCollisionSpace(blX, blY, w, h float64, data interface{}, tag string) *resolv.Object { - collider := resolv.NewObject(blX, blY, w, h, tag) // Unlike its frontend counter part, the position of a "resolv.Object" must be specified by "bottom-left point" because "w" and "h" must be positive, see "resolv.Object.BoundsToSpace" for details - shape := resolv.NewRectangle(0, 0, w, h) - collider.SetShape(shape) - collider.Data = data - return collider -} - -func GenerateConvexPolygonCollider(unalignedSrc *Polygon2D, spaceOffsetX, spaceOffsetY float64, data interface{}, tag string) *resolv.Object { - aligned := AlignPolygon2DToBoundingBox(unalignedSrc) - var w, h float64 = 0, 0 - - shape := resolv.NewConvexPolygon() - for i, pi := range aligned.Points { - for j, pj := range aligned.Points { - if i == j { - continue - } - if math.Abs(pj.X-pi.X) > w { - w = math.Abs(pj.X - pi.X) - } - if math.Abs(pj.Y-pi.Y) > h { - h = math.Abs(pj.Y - pi.Y) - } - } - } - - for i := 0; i < len(aligned.Points); i++ { - p := aligned.Points[i] - shape.AddPoints(p.X, p.Y) - } - - collider := resolv.NewObject(aligned.Anchor.X+spaceOffsetX, aligned.Anchor.Y+spaceOffsetY, w, h, tag) - collider.SetShape(shape) - collider.Data = data - - return collider -} - -func CalcPushbacks(oldDx, oldDy float64, playerShape, barrierShape *resolv.ConvexPolygon) (bool, float64, float64, *SatResult) { - origX, origY := playerShape.Position() - defer func() { - playerShape.SetPosition(origX, origY) - }() - playerShape.SetPosition(origX+oldDx, origY+oldDy) - - overlapResult := &SatResult{ - Overlap: 0, - OverlapX: 0, - OverlapY: 0, - AContainedInB: true, - BContainedInA: true, - Axis: vector.Vector{0, 0}, - } - if overlapped := isPolygonPairOverlapped(playerShape, barrierShape, overlapResult); overlapped { - pushbackX, pushbackY := overlapResult.Overlap*overlapResult.OverlapX, overlapResult.Overlap*overlapResult.OverlapY - return true, pushbackX, pushbackY, overlapResult - } else { - return false, 0, 0, overlapResult - } -} - -type SatResult struct { - Overlap float64 - OverlapX float64 - OverlapY float64 - AContainedInB bool - BContainedInA bool - Axis vector.Vector -} - -func isPolygonPairOverlapped(a, b *resolv.ConvexPolygon, result *SatResult) bool { - aCnt, bCnt := len(a.Points), len(b.Points) - // Single point case - if 1 == aCnt && 1 == bCnt { - if nil != result { - result.Overlap = 0 - } - return a.Points[0][0] == b.Points[0][0] && a.Points[0][1] == b.Points[0][1] - } - - //Logger.Info(fmt.Sprintf("Checking collision between a=%v, b=%v", ConvexPolygonStr(a), ConvexPolygonStr(b))) - if 1 < aCnt { - for _, axis := range a.SATAxes() { - if isPolygonPairSeparatedByDir(a, b, axis.Unit(), result) { - return false - } - } - } - - if 1 < bCnt { - for _, axis := range b.SATAxes() { - if isPolygonPairSeparatedByDir(a, b, axis.Unit(), result) { - return false - } - } - } - //Logger.Info(fmt.Sprintf("a=%v and b=%v are overlapped", ConvexPolygonStr(a), ConvexPolygonStr(b))) - - return true -} - -func isPolygonPairSeparatedByDir(a, b *resolv.ConvexPolygon, e vector.Vector, result *SatResult) bool { - /* - [WARNING] This function is deliberately made private, it shouldn't be used alone (i.e. not along the norms of a polygon), otherwise the pushbacks calculated would be meaningless. - - Consider the following example - a: { - anchor: [1337.19 1696.74] - points: [[0 0] [24 0] [24 24] [0 24]] - }, - b: { - anchor: [1277.72 1570.56] - points: [[642.57 319.16] [0 319.16] [5.73 0] [643.75 0.90]] - } - - e = (-2.98, 1.49).Unit() - */ - - //Logger.Info(fmt.Sprintf("Checking separation between a=%v, b=%v along axis e={%.3f, %.3f}#1", ConvexPolygonStr(a), ConvexPolygonStr(b), e[0], e[1])) - var aStart, aEnd, bStart, bEnd float64 = math.MaxFloat64, -math.MaxFloat64, math.MaxFloat64, -math.MaxFloat64 - for _, p := range a.Points { - dot := (p[0]+a.X)*e[0] + (p[1]+a.Y)*e[1] - - if aStart > dot { - aStart = dot - } - - if aEnd < dot { - aEnd = dot - } - } - - for _, p := range b.Points { - dot := (p[0]+b.X)*e[0] + (p[1]+b.Y)*e[1] - - if bStart > dot { - bStart = dot - } - - if bEnd < dot { - bEnd = dot - } - } - - if aStart > bEnd || aEnd < bStart { - // Separated by unit vector "e" - return true - } - - if nil != result { - overlap := float64(0) - - if aStart < bStart { - result.AContainedInB = false - - if aEnd < bEnd { - overlap = aEnd - bStart - result.BContainedInA = false - } else { - option1 := aEnd - bStart - option2 := bEnd - aStart - if option1 < option2 { - overlap = option1 - } else { - overlap = -option2 - } - } - } else { - result.BContainedInA = false - - if aEnd > bEnd { - overlap = aStart - bEnd - result.AContainedInB = false - } else { - option1 := aEnd - bStart - option2 := bEnd - aStart - if option1 < option2 { - overlap = option1 - } else { - overlap = -option2 - } - } - } - - currentOverlap := result.Overlap - absoluteOverlap := overlap - if overlap < 0 { - absoluteOverlap = -overlap - } - - if (0 == result.Axis[0] && 0 == result.Axis[1]) || currentOverlap > absoluteOverlap { - var sign float64 = 1 - if overlap < 0 { - sign = -1 - } - - result.Overlap = absoluteOverlap - result.OverlapX = e[0] * sign - result.OverlapY = e[1] * sign - } - - result.Axis = e - //Logger.Info(fmt.Sprintf("Checking separation between a=%v, b=%v along axis e={%.3f, %.3f}#2: aStart=%.3f, aEnd=%.3f, bStart=%.3f, bEnd=%.3f, overlap=%.3f, currentOverlap=%.3f, absoluteOverlap=%.3f, result=%v", ConvexPolygonStr(a), ConvexPolygonStr(b), e[0], e[1], aStart, aEnd, bStart, bEnd, overlap, currentOverlap, absoluteOverlap, result)) - } - - // the specified unit vector "e" doesn't separate "a" and "b", overlap result is generated - return false -} - -func WorldToVirtualGridPos(wx, wy, worldToVirtualGridRatio float64) (int32, int32) { - // [WARNING] Introduces loss of precision! - // In JavaScript floating numbers suffer from seemingly non-deterministic arithmetics, and even if certain libs solved this issue by approaches such as fixed-point-number, they might not be used in other libs -- e.g. the "collision libs" we're interested in -- thus couldn't kill all pains. - var virtualGridX int32 = int32(math.Round(wx * worldToVirtualGridRatio)) - var virtualGridY int32 = int32(math.Round(wy * worldToVirtualGridRatio)) - return virtualGridX, virtualGridY -} - -func VirtualGridToWorldPos(vx, vy int32, virtualGridToWorldRatio float64) (float64, float64) { - // No loss of precision - var wx float64 = float64(vx) * virtualGridToWorldRatio - var wy float64 = float64(vy) * virtualGridToWorldRatio - return wx, wy -} - -func WorldToPolygonColliderBLPos(wx, wy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY float64) (float64, float64) { - return wx - halfBoundingW - leftPadding + collisionSpaceOffsetX, wy - halfBoundingH - bottomPadding + collisionSpaceOffsetY -} - -func PolygonColliderBLToWorldPos(cx, cy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY float64) (float64, float64) { - return cx + halfBoundingW + leftPadding - collisionSpaceOffsetX, cy + halfBoundingH + bottomPadding - collisionSpaceOffsetY -} - -func PolygonColliderBLToVirtualGridPos(cx, cy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY float64, worldToVirtualGridRatio float64) (int32, int32) { - wx, wy := PolygonColliderBLToWorldPos(cx, cy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY) - return WorldToVirtualGridPos(wx, wy, worldToVirtualGridRatio) -} - -func VirtualGridToPolygonColliderBLPos(vx, vy int32, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY float64, virtualGridToWorldRatio float64) (float64, float64) { - wx, wy := VirtualGridToWorldPos(vx, vy, virtualGridToWorldRatio) - return WorldToPolygonColliderBLPos(wx, wy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY) -} diff --git a/dnmshared/tmx_parser.go b/dnmshared/tmx_parser.go index e67e3d7..516d133 100644 --- a/dnmshared/tmx_parser.go +++ b/dnmshared/tmx_parser.go @@ -3,13 +3,13 @@ package dnmshared import ( "bytes" "compress/zlib" - . "dnmshared/sharedprotos" "encoding/base64" "encoding/xml" "errors" "fmt" "go.uber.org/zap" "io/ioutil" + . "jsexport/battle" "math" "strconv" "strings" @@ -175,8 +175,8 @@ func (l *TmxLayer) decodeBase64() ([]uint32, error) { return gids, nil } -type StrToVec2DListMap map[string]*Vec2DList -type StrToPolygon2DListMap map[string]*Polygon2DList +type StrToVec2DListMap map[string]([]*Vec2D) +type StrToPolygon2DListMap map[string]([]*Polygon2D) func tmxPolylineToPolygon2D(pTmxMapIns *TmxMap, singleObjInTmxFile *TmxOrTsxObject, targetPolyline *TmxOrTsxPolyline) (*Polygon2D, error) { if nil == targetPolyline { @@ -321,13 +321,11 @@ func DeserializeTsxToColliderDict(pTmxMapIns *TmxMap, byteArrOfTsxFile []byte, f theStrToPolygon2DListMap = gidBoundariesMap[globalGid] } - var pThePolygon2DList *Polygon2DList + var pThePolygon2DList []*Polygon2D if _, ok := theStrToPolygon2DListMap[key]; ok { pThePolygon2DList = theStrToPolygon2DListMap[key] } else { - pThePolygon2DList = &Polygon2DList{ - Eles: make([]*Polygon2D, 0), - } + pThePolygon2DList = make([]*Polygon2D, 0) theStrToPolygon2DListMap[key] = pThePolygon2DList } @@ -335,7 +333,7 @@ func DeserializeTsxToColliderDict(pTmxMapIns *TmxMap, byteArrOfTsxFile []byte, f if nil != err { panic(err) } - pThePolygon2DList.Eles = append(pThePolygon2DList.Eles, thePolygon2DFromPolyline) + pThePolygon2DList = append(pThePolygon2DList, thePolygon2DFromPolyline) } } return nil @@ -348,12 +346,10 @@ func ParseTmxLayersAndGroups(pTmxMapIns *TmxMap, gidBoundariesMap map[int]StrToP for _, objGroup := range pTmxMapIns.ObjectGroups { switch objGroup.Name { case "PlayerStartingPos": - var pTheVec2DListToCache *Vec2DList + var pTheVec2DListToCache []*Vec2D _, ok := toRetStrToVec2DListMap[objGroup.Name] if false == ok { - pTheVec2DListToCache = &Vec2DList{ - Eles: make([]*Vec2D, 0), - } + pTheVec2DListToCache = make([]*Vec2D, 0) toRetStrToVec2DListMap[objGroup.Name] = pTheVec2DListToCache } pTheVec2DListToCache = toRetStrToVec2DListMap[objGroup.Name] @@ -363,16 +359,14 @@ func ParseTmxLayersAndGroups(pTmxMapIns *TmxMap, gidBoundariesMap map[int]StrToP Y: singleObjInTmxFile.Y, } thePosInWorld := pTmxMapIns.continuousObjLayerOffsetToContinuousMapNodePos(theUntransformedPos) - pTheVec2DListToCache.Eles = append(pTheVec2DListToCache.Eles, &thePosInWorld) + pTheVec2DListToCache = append(pTheVec2DListToCache, &thePosInWorld) } case "Barrier": // Note that in this case, the "Polygon2D.Anchor" of each "TmxOrTsxObject" is exactly overlapping with "Polygon2D.Points[0]". - var pThePolygon2DListToCache *Polygon2DList + var pThePolygon2DListToCache []*Polygon2D _, ok := toRetStrToPolygon2DListMap[objGroup.Name] if false == ok { - pThePolygon2DListToCache = &Polygon2DList{ - Eles: make([]*Polygon2D, 0), - } + pThePolygon2DListToCache = make([]*Polygon2D, 0) toRetStrToPolygon2DListMap[objGroup.Name] = pThePolygon2DListToCache } @@ -408,7 +402,7 @@ func ParseTmxLayersAndGroups(pTmxMapIns *TmxMap, gidBoundariesMap map[int]StrToP if nil != err { panic(err) } - pThePolygon2DListToCache.Eles = append(pThePolygon2DListToCache.Eles, thePolygon2DInWorld) + pThePolygon2DListToCache = append(pThePolygon2DListToCache, thePolygon2DInWorld) } default: } diff --git a/frontend/assets/plugin_scripts/jsexport.js b/frontend/assets/plugin_scripts/jsexport.js index 9f8e428..9a8d49b 100644 --- a/frontend/assets/plugin_scripts/jsexport.js +++ b/frontend/assets/plugin_scripts/jsexport.js @@ -42,8 +42,8 @@ $packages["os"]=(function(){var $pkg={},$init,D,Q,E,O,J,M,K,F,L,G,C,H,P,I,N,A,B, $packages["fmt"]=(function(){var $pkg={},$init,A,I,B,C,D,E,F,G,H,V,W,X,AK,AL,AM,AN,AO,AP,BG,BH,BK,BL,BM,BN,BO,BP,BS,BT,CO,CP,CQ,CS,Y,AC,AE,AF,AQ,Z,AA,AG,AR,AX,BB;A=$packages["errors"];I=$packages["internal/fmtsort"];B=$packages["io"];C=$packages["math"];D=$packages["os"];E=$packages["reflect"];F=$packages["strconv"];G=$packages["sync"];H=$packages["unicode/utf8"];V=$pkg.scanError=$newType(0,$kindStruct,"fmt.scanError",true,"fmt",false,function(err_){this.$val=this;if(arguments.length===0){this.err=$ifaceNil;return;}this.err=err_;});W=$pkg.ss=$newType(0,$kindStruct,"fmt.ss",true,"fmt",false,function(rs_,buf_,count_,atEOF_,ssave_){this.$val=this;if(arguments.length===0){this.rs=$ifaceNil;this.buf=AO.nil;this.count=0;this.atEOF=false;this.ssave=new X.ptr(false,false,false,0,0,0);return;}this.rs=rs_;this.buf=buf_;this.count=count_;this.atEOF=atEOF_;this.ssave=ssave_;});X=$pkg.ssave=$newType(0,$kindStruct,"fmt.ssave",true,"fmt",false,function(validSave_,nlIsEnd_,nlIsSpace_,argLimit_,limit_,maxWid_){this.$val=this;if(arguments.length===0){this.validSave=false;this.nlIsEnd=false;this.nlIsSpace=false;this.argLimit=0;this.limit=0;this.maxWid=0;return;}this.validSave=validSave_;this.nlIsEnd=nlIsEnd_;this.nlIsSpace=nlIsSpace_;this.argLimit=argLimit_;this.limit=limit_;this.maxWid=maxWid_;});AK=$pkg.State=$newType(8,$kindInterface,"fmt.State",true,"fmt",true,null);AL=$pkg.Formatter=$newType(8,$kindInterface,"fmt.Formatter",true,"fmt",true,null);AM=$pkg.Stringer=$newType(8,$kindInterface,"fmt.Stringer",true,"fmt",true,null);AN=$pkg.GoStringer=$newType(8,$kindInterface,"fmt.GoStringer",true,"fmt",true,null);AO=$pkg.buffer=$newType(12,$kindSlice,"fmt.buffer",true,"fmt",false,null);AP=$pkg.pp=$newType(0,$kindStruct,"fmt.pp",true,"fmt",false,function(buf_,arg_,value_,fmt_,reordered_,goodArgNum_,panicking_,erroring_,wrapErrs_,wrappedErr_){this.$val=this;if(arguments.length===0){this.buf=AO.nil;this.arg=$ifaceNil;this.value=new E.Value.ptr(BN.nil,0,0);this.fmt=new BH.ptr(BO.nil,new BG.ptr(false,false,false,false,false,false,false,false,false),0,0,BP.zero());this.reordered=false;this.goodArgNum=false;this.panicking=false;this.erroring=false;this.wrapErrs=false;this.wrappedErr=$ifaceNil;return;}this.buf=buf_;this.arg=arg_;this.value=value_;this.fmt=fmt_;this.reordered=reordered_;this.goodArgNum=goodArgNum_;this.panicking=panicking_;this.erroring=erroring_;this.wrapErrs=wrapErrs_;this.wrappedErr=wrappedErr_;});BG=$pkg.fmtFlags=$newType(0,$kindStruct,"fmt.fmtFlags",true,"fmt",false,function(widPresent_,precPresent_,minus_,plus_,sharp_,space_,zero_,plusV_,sharpV_){this.$val=this;if(arguments.length===0){this.widPresent=false;this.precPresent=false;this.minus=false;this.plus=false;this.sharp=false;this.space=false;this.zero=false;this.plusV=false;this.sharpV=false;return;}this.widPresent=widPresent_;this.precPresent=precPresent_;this.minus=minus_;this.plus=plus_;this.sharp=sharp_;this.space=space_;this.zero=zero_;this.plusV=plusV_;this.sharpV=sharpV_;});BH=$pkg.fmt=$newType(0,$kindStruct,"fmt.fmt",true,"fmt",false,function(buf_,fmtFlags_,wid_,prec_,intbuf_){this.$val=this;if(arguments.length===0){this.buf=BO.nil;this.fmtFlags=new BG.ptr(false,false,false,false,false,false,false,false,false);this.wid=0;this.prec=0;this.intbuf=BP.zero();return;}this.buf=buf_;this.fmtFlags=fmtFlags_;this.wid=wid_;this.prec=prec_;this.intbuf=intbuf_;});BK=$arrayType($Uint16,2);BL=$sliceType(BK);BM=$sliceType($emptyInterface);BN=$ptrType(E.rtype);BO=$ptrType(AO);BP=$arrayType($Uint8,68);BS=$sliceType($Uint8);BT=$ptrType(W);CO=$ptrType(AP);CP=$arrayType($Uint8,6);CQ=$funcType([$Int32],[$Bool],false);CS=$ptrType(BH);W.ptr.prototype.Read=function(a){var a,b,c,d,e,f;b=0;c=$ifaceNil;d=this;e=0;f=A.New("ScanState's Read should not be called. Use ReadRune");b=e;c=f;return[b,c];};W.prototype.Read=function(a){return this.$val.Read(a);};W.ptr.prototype.ReadRune=function(){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=0;b=0;c=$ifaceNil;d=this;if(d.atEOF||d.count>=d.ssave.argLimit){c=B.EOF;$s=-1;return[a,b,c];}f=d.rs.ReadRune();$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}e=f;a=e[0];b=e[1];c=e[2];if($interfaceIsEqual(c,$ifaceNil)){d.count=d.count+(1)>>0;if(d.ssave.nlIsEnd&&(a===10)){d.atEOF=true;}}else if($interfaceIsEqual(c,B.EOF)){d.atEOF=true;}$s=-1;return[a,b,c];}return;}var $f={$blk:W.ptr.prototype.ReadRune,$c:true,$r,a,b,c,d,e,f,$s};return $f;};W.prototype.ReadRune=function(){return this.$val.ReadRune();};W.ptr.prototype.Width=function(){var a,b,c,d,e,f,g;a=0;b=false;c=this;if(c.ssave.maxWid===1073741824){d=0;e=false;a=d;b=e;return[a,b];}f=c.ssave.maxWid;g=true;a=f;b=g;return[a,b];};W.prototype.Width=function(){return this.$val.Width();};W.ptr.prototype.getRune=function(){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=0;b=this;d=b.ReadRune();$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}c=d;a=c[0];e=c[2];if(!($interfaceIsEqual(e,$ifaceNil))){if($interfaceIsEqual(e,B.EOF)){a=-1;$s=-1;return a;}b.error(e);}$s=-1;return a;}return;}var $f={$blk:W.ptr.prototype.getRune,$c:true,$r,a,b,c,d,e,$s};return $f;};W.prototype.getRune=function(){return this.$val.getRune();};W.ptr.prototype.UnreadRune=function(){var{a,b,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;b=a.rs.UnreadRune();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}b;a.atEOF=false;a.count=a.count-(1)>>0;$s=-1;return $ifaceNil;}return;}var $f={$blk:W.ptr.prototype.UnreadRune,$c:true,$r,a,b,$s};return $f;};W.prototype.UnreadRune=function(){return this.$val.UnreadRune();};W.ptr.prototype.error=function(a){var a,b,c;b=this;$panic((c=new V.ptr(a),new c.constructor.elem(c)));};W.prototype.error=function(a){return this.$val.error(a);};W.ptr.prototype.errorString=function(a){var a,b,c;b=this;$panic((c=new V.ptr(A.New(a)),new c.constructor.elem(c)));};W.prototype.errorString=function(a){return this.$val.errorString(a);};W.ptr.prototype.Token=function(a,b){var{a,b,c,d,e,f,g,$s,$deferred,$r,$c}=$restore(this,{a,b});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);c=[c];d=BS.nil;c[0]=$ifaceNil;e=this;$deferred.push([(function(c){return function(){var f,g,h,i;f=$recover();if(!($interfaceIsEqual(f,$ifaceNil))){g=$assertType(f,V,true);h=$clone(g[0],V);i=g[1];if(i){c[0]=h.err;}else{$panic(f);}}};})(c),[]]);if(b===$throwNilPointerError){b=AA;}e.buf=$subslice(e.buf,0,0);f=e.token(a,b);$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}d=f;g=[d,c[0]];$s=2;case 2:return g;}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return[d,c[0]];}if($curGoroutine.asleep){var $f={$blk:W.ptr.prototype.Token,$c:true,$r,a,b,c,d,e,f,g,$s,$deferred};return $f;}}};W.prototype.Token=function(a,b){return this.$val.Token(a,b);};Z=function(a){var a,b,c,d,e;if(a>=65536){return false;}b=((a<<16>>>16));c=Y;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]),BK);if(b1024){return;}b.buf=$subslice(b.buf,0,0);b.rs=$ifaceNil;AC.Put(b);};W.prototype.free=function(a){return this.$val.free(a);};W.ptr.prototype.SkipSpace=function(){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=this;case 1:b=a.getRune();$s=3;case 3:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=b;if(c===-1){$s=-1;return;}if(!(c===13)){d=false;$s=6;continue s;}e=a.peek("\n");$s=7;case 7:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;case 6:if(d){$s=4;continue;}$s=5;continue;case 4:$s=1;continue;case 5:if(c===10){if(a.ssave.nlIsSpace){$s=1;continue;}a.errorString("unexpected newline");$s=-1;return;}if(!Z(c)){$s=8;continue;}$s=9;continue;case 8:f=a.UnreadRune();$s=10;case 10:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}f;$s=2;continue;case 9:$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:W.ptr.prototype.SkipSpace,$c:true,$r,a,b,c,d,e,f,$s};return $f;};W.prototype.SkipSpace=function(){return this.$val.SkipSpace();};W.ptr.prototype.token=function(a,b){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=this;if(a){$s=1;continue;}$s=2;continue;case 1:$r=c.SkipSpace();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 2:case 4:d=c.getRune();$s=6;case 6:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;if(e===-1){$s=5;continue;}f=b(e);$s=9;case 9:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}if(!f){$s=7;continue;}$s=8;continue;case 7:g=c.UnreadRune();$s=10;case 10:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}g;$s=5;continue;case 8:(c.$ptr_buf||(c.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},c))).writeRune(e);$s=4;continue;case 5:$s=-1;return $convertSliceType(c.buf,BS);}return;}var $f={$blk:W.ptr.prototype.token,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};W.prototype.token=function(a,b){return this.$val.token(a,b);};AG=function(a,b){var a,b,c,d,e,f,g;c=a;d=0;while(true){if(!(d=0;}return;}var $f={$blk:W.ptr.prototype.peek,$c:true,$r,a,b,c,d,e,$s};return $f;};W.prototype.peek=function(a){return this.$val.peek(a);};$ptrType(AO).prototype.write=function(a){var a,b;b=this;b.$set($appendSlice(b.$get(),a));};$ptrType(AO).prototype.writeString=function(a){var a,b;b=this;b.$set($appendSlice(b.$get(),a));};$ptrType(AO).prototype.writeByte=function(a){var a,b;b=this;b.$set($append(b.$get(),a));};$ptrType(AO).prototype.writeRune=function(a){var a,b,c,d,e;b=this;if(a<128){b.$set($append(b.$get(),((a<<24>>>24))));return;}c=b.$get();d=c.$length;while(true){if(!((d+4>>0)>c.$capacity)){break;}c=$append(c,0);}e=H.EncodeRune($convertSliceType($subslice(c,d,(d+4>>0)),BS),a);b.$set($subslice(c,0,(d+e>>0)));};AR=function(){var{a,b,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a=AQ.Get();$s=1;case 1:if($c){$c=false;a=a.$blk();}if(a&&a.$blk!==undefined){break s;}b=$assertType(a,CO);b.panicking=false;b.erroring=false;b.wrapErrs=false;b.fmt.init((b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))));$s=-1;return b;}return;}var $f={$blk:AR,$c:true,$r,a,b,$s};return $f;};AP.ptr.prototype.free=function(){var a;a=this;if(a.buf.$capacity>65536){return;}a.buf=$subslice(a.buf,0,0);a.arg=$ifaceNil;a.value=new E.Value.ptr(BN.nil,0,0);a.wrappedErr=$ifaceNil;AQ.Put(a);};AP.prototype.free=function(){return this.$val.free();};AP.ptr.prototype.Width=function(){var a,b,c,d,e;a=0;b=false;c=this;d=c.fmt.wid;e=c.fmt.fmtFlags.widPresent;a=d;b=e;return[a,b];};AP.prototype.Width=function(){return this.$val.Width();};AP.ptr.prototype.Precision=function(){var a,b,c,d,e;a=0;b=false;c=this;d=c.fmt.prec;e=c.fmt.fmtFlags.precPresent;a=d;b=e;return[a,b];};AP.prototype.Precision=function(){return this.$val.Precision();};AP.ptr.prototype.Flag=function(a){var a,b,c;b=this;c=a;if(c===(45)){return b.fmt.fmtFlags.minus;}else if(c===(43)){return b.fmt.fmtFlags.plus||b.fmt.fmtFlags.plusV;}else if(c===(35)){return b.fmt.fmtFlags.sharp||b.fmt.fmtFlags.sharpV;}else if(c===(32)){return b.fmt.fmtFlags.space;}else if(c===(48)){return b.fmt.fmtFlags.zero;}return false;};AP.prototype.Flag=function(a){return this.$val.Flag(a);};AP.ptr.prototype.Write=function(a){var a,b,c,d,e,f;b=0;c=$ifaceNil;d=this;(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).write(a);e=a.$length;f=$ifaceNil;b=e;c=f;return[b,c];};AP.prototype.Write=function(a){return this.$val.Write(a);};AP.ptr.prototype.WriteString=function(a){var a,b,c,d,e,f;b=0;c=$ifaceNil;d=this;(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(a);e=a.length;f=$ifaceNil;b=e;c=f;return[b,c];};AP.prototype.WriteString=function(a){return this.$val.WriteString(a);};AX=function(a){var{a,b,c,d,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=AR();$s=1;case 1:if($c){$c=false;b=b.$blk();}if(b&&b.$blk!==undefined){break s;}c=b;$r=c.doPrint(a);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d=($bytesToString(c.buf));c.free();$s=-1;return d;}return;}var $f={$blk:AX,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.Sprint=AX;BB=function(a,b){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=$clone(a,E.Value).Field(b);$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;if(($clone(d,E.Value).Kind()===20)&&!$clone(d,E.Value).IsNil()){$s=2;continue;}$s=3;continue;case 2:e=$clone(d,E.Value).Elem();$s=4;case 4:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d=e;case 3:$s=-1;return d;}return;}var $f={$blk:BB,$c:true,$r,a,b,c,d,e,$s};return $f;};AP.ptr.prototype.unknownType=function(a){var{a,b,c,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;if(!$clone(a,E.Value).IsValid()){(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeString("");$s=-1;return;}(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(63);c=$clone(a,E.Value).Type().String();$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeString(c);$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(63);$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.unknownType,$c:true,$r,a,b,c,$s};return $f;};AP.prototype.unknownType=function(a){return this.$val.unknownType(a);};AP.ptr.prototype.badVerb=function(a){var{a,b,c,d,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;b.erroring=true;(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeString("%!");(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeRune(a);(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(40);if(!($interfaceIsEqual(b.arg,$ifaceNil))){$s=2;continue;}if($clone(b.value,E.Value).IsValid()){$s=3;continue;}$s=4;continue;case 2:c=E.TypeOf(b.arg).String();$s=6;case 6:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}$r=(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeString(c);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(61);$r=b.printArg(b.arg,118);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=5;continue;case 3:d=$clone(b.value,E.Value).Type().String();$s=9;case 9:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}$r=(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeString(d);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(61);$r=b.printValue($clone(b.value,E.Value),118,0);$s=11;case 11:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=5;continue;case 4:(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeString("");case 5:case 1:(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(41);b.erroring=false;$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.badVerb,$c:true,$r,a,b,c,d,$s};return $f;};AP.prototype.badVerb=function(a){return this.$val.badVerb(a);};AP.ptr.prototype.fmtBool=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=this;d=b;if((d===(116))||(d===(118))){$s=2;continue;}$s=3;continue;case 2:c.fmt.fmtBoolean(a);$s=4;continue;case 3:$r=c.badVerb(b);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 4:case 1:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtBool,$c:true,$r,a,b,c,d,$s};return $f;};AP.prototype.fmtBool=function(a,b){return this.$val.fmtBool(a,b);};AP.ptr.prototype.fmt0x64=function(a,b){var a,b,c,d;c=this;d=c.fmt.fmtFlags.sharp;c.fmt.fmtFlags.sharp=b;c.fmt.fmtInteger(a,16,false,118,"0123456789abcdefx");c.fmt.fmtFlags.sharp=d;};AP.prototype.fmt0x64=function(a,b){return this.$val.fmt0x64(a,b);};AP.ptr.prototype.fmtInteger=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=c;if(e===(118)){$s=2;continue;}if(e===(100)){$s=3;continue;}if(e===(98)){$s=4;continue;}if((e===(111))||(e===(79))){$s=5;continue;}if(e===(120)){$s=6;continue;}if(e===(88)){$s=7;continue;}if(e===(99)){$s=8;continue;}if(e===(113)){$s=9;continue;}if(e===(85)){$s=10;continue;}$s=11;continue;case 2:if(d.fmt.fmtFlags.sharpV&&!b){d.fmt0x64(a,true);}else{d.fmt.fmtInteger(a,10,b,c,"0123456789abcdefx");}$s=12;continue;case 3:d.fmt.fmtInteger(a,10,b,c,"0123456789abcdefx");$s=12;continue;case 4:d.fmt.fmtInteger(a,2,b,c,"0123456789abcdefx");$s=12;continue;case 5:d.fmt.fmtInteger(a,8,b,c,"0123456789abcdefx");$s=12;continue;case 6:d.fmt.fmtInteger(a,16,b,c,"0123456789abcdefx");$s=12;continue;case 7:d.fmt.fmtInteger(a,16,b,c,"0123456789ABCDEFX");$s=12;continue;case 8:d.fmt.fmtC(a);$s=12;continue;case 9:d.fmt.fmtQc(a);$s=12;continue;case 10:d.fmt.fmtUnicode(a);$s=12;continue;case 11:$r=d.badVerb(c);$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 12:case 1:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtInteger,$c:true,$r,a,b,c,d,e,$s};return $f;};AP.prototype.fmtInteger=function(a,b,c){return this.$val.fmtInteger(a,b,c);};AP.ptr.prototype.fmtFloat=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=c;if(e===(118)){$s=2;continue;}if((e===(98))||(e===(103))||(e===(71))||(e===(120))||(e===(88))){$s=3;continue;}if((e===(102))||(e===(101))||(e===(69))){$s=4;continue;}if(e===(70)){$s=5;continue;}$s=6;continue;case 2:d.fmt.fmtFloat(a,b,103,-1);$s=7;continue;case 3:d.fmt.fmtFloat(a,b,c,-1);$s=7;continue;case 4:d.fmt.fmtFloat(a,b,c,6);$s=7;continue;case 5:d.fmt.fmtFloat(a,b,102,6);$s=7;continue;case 6:$r=d.badVerb(c);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 7:case 1:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtFloat,$c:true,$r,a,b,c,d,e,$s};return $f;};AP.prototype.fmtFloat=function(a,b,c){return this.$val.fmtFloat(a,b,c);};AP.ptr.prototype.fmtComplex=function(a,b,c){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=c;if((e===(118))||(e===(98))||(e===(103))||(e===(71))||(e===(120))||(e===(88))||(e===(102))||(e===(70))||(e===(101))||(e===(69))){$s=2;continue;}$s=3;continue;case 2:f=d.fmt.fmtFlags.plus;(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(40);$r=d.fmtFloat(a.$real,(g=b/2,(g===g&&g!==1/0&&g!==-1/0)?g>>0:$throwRuntimeError("integer divide by zero")),c);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d.fmt.fmtFlags.plus=true;$r=d.fmtFloat(a.$imag,(h=b/2,(h===h&&h!==1/0&&h!==-1/0)?h>>0:$throwRuntimeError("integer divide by zero")),c);$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("i)");d.fmt.fmtFlags.plus=f;$s=4;continue;case 3:$r=d.badVerb(c);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 4:case 1:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtComplex,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AP.prototype.fmtComplex=function(a,b,c){return this.$val.fmtComplex(a,b,c);};AP.ptr.prototype.fmtString=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=this;d=b;if(d===(118)){$s=2;continue;}if(d===(115)){$s=3;continue;}if(d===(120)){$s=4;continue;}if(d===(88)){$s=5;continue;}if(d===(113)){$s=6;continue;}$s=7;continue;case 2:if(c.fmt.fmtFlags.sharpV){c.fmt.fmtQ(a);}else{c.fmt.fmtS(a);}$s=8;continue;case 3:c.fmt.fmtS(a);$s=8;continue;case 4:c.fmt.fmtSx(a,"0123456789abcdefx");$s=8;continue;case 5:c.fmt.fmtSx(a,"0123456789ABCDEFX");$s=8;continue;case 6:c.fmt.fmtQ(a);$s=8;continue;case 7:$r=c.badVerb(b);$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 8:case 1:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtString,$c:true,$r,a,b,c,d,$s};return $f;};AP.prototype.fmtString=function(a,b){return this.$val.fmtString(a,b);};AP.ptr.prototype.fmtBytes=function(a,b,c){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=b;if((e===(118))||(e===(100))){$s=2;continue;}if(e===(115)){$s=3;continue;}if(e===(120)){$s=4;continue;}if(e===(88)){$s=5;continue;}if(e===(113)){$s=6;continue;}$s=7;continue;case 2:if(d.fmt.fmtFlags.sharpV){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(c);if(a===BS.nil){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("(nil)");$s=-1;return;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(123);f=a;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);if(h>0){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(", ");}d.fmt0x64((new $Uint64(0,i)),true);g++;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(125);}else{(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(91);j=a;k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);if(l>0){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(32);}d.fmt.fmtInteger((new $Uint64(0,m)),10,false,b,"0123456789abcdefx");k++;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(93);}$s=8;continue;case 3:d.fmt.fmtBs(a);$s=8;continue;case 4:d.fmt.fmtBx(a,"0123456789abcdefx");$s=8;continue;case 5:d.fmt.fmtBx(a,"0123456789ABCDEFX");$s=8;continue;case 6:d.fmt.fmtQ(($bytesToString(a)));$s=8;continue;case 7:n=E.ValueOf(a);$s=9;case 9:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}$r=d.printValue($clone(n,E.Value),b,0);$s=10;case 10:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 8:case 1:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtBytes,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,$s};return $f;};AP.prototype.fmtBytes=function(a,b,c){return this.$val.fmtBytes(a,b,c);};AP.ptr.prototype.fmtPointer=function(a,b){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=this;d=0;e=$clone(a,E.Value).Kind();if((e===(18))||(e===(19))||(e===(21))||(e===(22))||(e===(23))||(e===(26))){$s=2;continue;}$s=3;continue;case 2:d=$clone(a,E.Value).Pointer();$s=4;continue;case 3:$r=c.badVerb(b);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 4:case 1:f=b;if(f===(118)){$s=7;continue;}if(f===(112)){$s=8;continue;}if((f===(98))||(f===(111))||(f===(100))||(f===(120))||(f===(88))){$s=9;continue;}$s=10;continue;case 7:if(c.fmt.fmtFlags.sharpV){$s=12;continue;}$s=13;continue;case 12:(c.$ptr_buf||(c.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},c))).writeByte(40);g=$clone(a,E.Value).Type().String();$s=15;case 15:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}$r=(c.$ptr_buf||(c.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},c))).writeString(g);$s=16;case 16:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(c.$ptr_buf||(c.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},c))).writeString(")(");if(d===0){(c.$ptr_buf||(c.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},c))).writeString("nil");}else{c.fmt0x64((new $Uint64(0,d.constructor===Number?d:1)),true);}(c.$ptr_buf||(c.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},c))).writeByte(41);$s=14;continue;case 13:if(d===0){c.fmt.padString("");}else{c.fmt0x64((new $Uint64(0,d.constructor===Number?d:1)),!c.fmt.fmtFlags.sharp);}case 14:$s=11;continue;case 8:c.fmt0x64((new $Uint64(0,d.constructor===Number?d:1)),!c.fmt.fmtFlags.sharp);$s=11;continue;case 9:$r=c.fmtInteger((new $Uint64(0,d.constructor===Number?d:1)),false,b);$s=17;case 17:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=11;continue;case 10:$r=c.badVerb(b);$s=18;case 18:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 11:case 6:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.fmtPointer,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};AP.prototype.fmtPointer=function(a,b){return this.$val.fmtPointer(a,b);};AP.ptr.prototype.catchPanic=function(a,b,c){var{a,b,c,d,e,f,g,h,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=$recover();if(!($interfaceIsEqual(e,$ifaceNil))){$s=1;continue;}$s=2;continue;case 1:f=E.ValueOf(a);$s=3;case 3:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;if(($clone(g,E.Value).Kind()===22)&&$clone(g,E.Value).IsNil()){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("");$s=-1;return;}if(d.panicking){$panic(e);}h=$clone(d.fmt.fmtFlags,BG);d.fmt.clearflags();(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("%!");(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeRune(b);(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("(PANIC=");(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(c);(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(" method: ");d.panicking=true;$r=d.printArg(e,118);$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}d.panicking=false;(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(41);BG.copy(d.fmt.fmtFlags,h);case 2:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.catchPanic,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AP.prototype.catchPanic=function(a,b,c){return this.$val.catchPanic(a,b,c);};AP.ptr.prototype.handleMethods=function(a){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,z,$s,$deferred,$r,$c}=$restore(this,{a});$s=$s||0;var $err=null;try{s:while(true){switch($s){case 0:$deferred=[];$curGoroutine.deferStack.push($deferred);b=false;c=this;if(c.erroring){$s=1;continue;}$s=2;continue;case 1:d=b;$s=3;case 3:return d;case 2:if(a===119){$s=4;continue;}$s=5;continue;case 4:e=$assertType(c.arg,$error,true);f=e[0];g=e[1];if(!g||!c.wrapErrs||!($interfaceIsEqual(c.wrappedErr,$ifaceNil))){$s=6;continue;}$s=7;continue;case 6:c.wrappedErr=$ifaceNil;c.wrapErrs=false;$r=c.badVerb(a);$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}b=true;h=b;$s=9;case 9:return h;case 7:c.wrappedErr=f;a=118;case 5:i=$assertType(c.arg,AL,true);j=i[0];k=i[1];if(k){$s=10;continue;}$s=11;continue;case 10:b=true;$deferred.push([$methodVal(c,"catchPanic"),[c.arg,a,"Format"]]);$r=j.Format(c,a);$s=12;case 12:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}l=b;$s=13;case 13:return l;case 11:if(c.fmt.fmtFlags.sharpV){$s=14;continue;}$s=15;continue;case 14:m=$assertType(c.arg,AN,true);n=m[0];o=m[1];if(o){$s=17;continue;}$s=18;continue;case 17:b=true;$deferred.push([$methodVal(c,"catchPanic"),[c.arg,a,"GoString"]]);p=n.GoString();$s=19;case 19:if($c){$c=false;p=p.$blk();}if(p&&p.$blk!==undefined){break s;}$r=c.fmt.fmtS(p);$s=20;case 20:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}q=b;$s=21;case 21:return q;case 18:$s=16;continue;case 15:r=a;if((r===(118))||(r===(115))||(r===(120))||(r===(88))||(r===(113))){$s=23;continue;}$s=24;continue;case 23:s=c.arg;if($assertType(s,$error,true)[1]){$s=25;continue;}if($assertType(s,AM,true)[1]){$s=26;continue;}$s=27;continue;case 25:t=s;b=true;$deferred.push([$methodVal(c,"catchPanic"),[c.arg,a,"Error"]]);v=t.Error();$s=28;case 28:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}$r=c.fmtString(v,a);$s=29;case 29:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}w=b;$s=30;case 30:return w;case 26:u=s;b=true;$deferred.push([$methodVal(c,"catchPanic"),[c.arg,a,"String"]]);x=u.String();$s=31;case 31:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}$r=c.fmtString(x,a);$s=32;case 32:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}y=b;$s=33;case 33:return y;case 27:case 24:case 22:case 16:b=false;z=b;$s=34;case 34:return z;}return;}}catch(err){$err=err;$s=-1;}finally{$callDeferred($deferred,$err);if(!$curGoroutine.asleep){return b;}if($curGoroutine.asleep){var $f={$blk:AP.ptr.prototype.handleMethods,$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,x,y,z,$s,$deferred};return $f;}}};AP.prototype.handleMethods=function(a){return this.$val.handleMethods(a);};AP.ptr.prototype.printArg=function(a,b){var{a,aa,ab,ac,ad,ae,af,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});$s=$s||0;s:while(true){switch($s){case 0:c=this;c.arg=a;c.value=new E.Value.ptr(BN.nil,0,0);if($interfaceIsEqual(a,$ifaceNil)){$s=1;continue;}$s=2;continue;case 1:d=b;if((d===(84))||(d===(118))){$s=4;continue;}$s=5;continue;case 4:c.fmt.padString("");$s=6;continue;case 5:$r=c.badVerb(b);$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 6:case 3:$s=-1;return;case 2:e=b;if(e===(84)){$s=9;continue;}if(e===(112)){$s=10;continue;}$s=11;continue;case 9:f=E.TypeOf(a).String();$s=12;case 12:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}$r=c.fmt.fmtS(f);$s=13;case 13:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 10:g=E.ValueOf(a);$s=14;case 14:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}$r=c.fmtPointer($clone(g,E.Value),112);$s=15;case 15:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 11:case 8:h=a;if($assertType(h,$Bool,true)[1]){$s=16;continue;}if($assertType(h,$Float32,true)[1]){$s=17;continue;}if($assertType(h,$Float64,true)[1]){$s=18;continue;}if($assertType(h,$Complex64,true)[1]){$s=19;continue;}if($assertType(h,$Complex128,true)[1]){$s=20;continue;}if($assertType(h,$Int,true)[1]){$s=21;continue;}if($assertType(h,$Int8,true)[1]){$s=22;continue;}if($assertType(h,$Int16,true)[1]){$s=23;continue;}if($assertType(h,$Int32,true)[1]){$s=24;continue;}if($assertType(h,$Int64,true)[1]){$s=25;continue;}if($assertType(h,$Uint,true)[1]){$s=26;continue;}if($assertType(h,$Uint8,true)[1]){$s=27;continue;}if($assertType(h,$Uint16,true)[1]){$s=28;continue;}if($assertType(h,$Uint32,true)[1]){$s=29;continue;}if($assertType(h,$Uint64,true)[1]){$s=30;continue;}if($assertType(h,$Uintptr,true)[1]){$s=31;continue;}if($assertType(h,$String,true)[1]){$s=32;continue;}if($assertType(h,BS,true)[1]){$s=33;continue;}if($assertType(h,E.Value,true)[1]){$s=34;continue;}$s=35;continue;case 16:i=h.$val;$r=c.fmtBool(i,b);$s=37;case 37:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 17:j=h.$val;$r=c.fmtFloat((j),32,b);$s=38;case 38:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 18:k=h.$val;$r=c.fmtFloat(k,64,b);$s=39;case 39:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 19:l=h.$val;$r=c.fmtComplex((new $Complex128(l.$real,l.$imag)),64,b);$s=40;case 40:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 20:m=h.$val;$r=c.fmtComplex(m,128,b);$s=41;case 41:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 21:n=h.$val;$r=c.fmtInteger((new $Uint64(0,n)),true,b);$s=42;case 42:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 22:o=h.$val;$r=c.fmtInteger((new $Uint64(0,o)),true,b);$s=43;case 43:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 23:p=h.$val;$r=c.fmtInteger((new $Uint64(0,p)),true,b);$s=44;case 44:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 24:q=h.$val;$r=c.fmtInteger((new $Uint64(0,q)),true,b);$s=45;case 45:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 25:r=h.$val;$r=c.fmtInteger((new $Uint64(r.$high,r.$low)),true,b);$s=46;case 46:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 26:s=h.$val;$r=c.fmtInteger((new $Uint64(0,s)),false,b);$s=47;case 47:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 27:t=h.$val;$r=c.fmtInteger((new $Uint64(0,t)),false,b);$s=48;case 48:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 28:u=h.$val;$r=c.fmtInteger((new $Uint64(0,u)),false,b);$s=49;case 49:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 29:v=h.$val;$r=c.fmtInteger((new $Uint64(0,v)),false,b);$s=50;case 50:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 30:w=h.$val;$r=c.fmtInteger(w,false,b);$s=51;case 51:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 31:x=h.$val;$r=c.fmtInteger((new $Uint64(0,x.constructor===Number?x:1)),false,b);$s=52;case 52:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 32:y=h.$val;$r=c.fmtString(y,b);$s=53;case 53:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 33:z=h.$val;$r=c.fmtBytes(z,b,"[]byte");$s=54;case 54:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 34:aa=h.$val;if($clone(aa,E.Value).IsValid()&&$clone(aa,E.Value).CanInterface()){$s=55;continue;}$s=56;continue;case 55:ac=$clone(aa,E.Value).Interface();$s=57;case 57:if($c){$c=false;ac=ac.$blk();}if(ac&&ac.$blk!==undefined){break s;}c.arg=ac;ad=c.handleMethods(b);$s=60;case 60:if($c){$c=false;ad=ad.$blk();}if(ad&&ad.$blk!==undefined){break s;}if(ad){$s=58;continue;}$s=59;continue;case 58:$s=-1;return;case 59:case 56:$r=c.printValue($clone(aa,E.Value),b,0);$s=61;case 61:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=36;continue;case 35:ab=h;ae=c.handleMethods(b);$s=64;case 64:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}if(!ae){$s=62;continue;}$s=63;continue;case 62:af=E.ValueOf(ab);$s=65;case 65:if($c){$c=false;af=af.$blk();}if(af&&af.$blk!==undefined){break s;}$r=c.printValue($clone(af,E.Value),b,0);$s=66;case 66:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 63:case 36:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.printArg,$c:true,$r,a,aa,ab,ac,ad,ae,af,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;};AP.prototype.printArg=function(a,b){return this.$val.printArg(a,b);};AP.ptr.prototype.printValue=function(a,b,c){var{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,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});$s=$s||0;s:while(true){switch($s){case 0:d=this;if(c>0&&$clone(a,E.Value).IsValid()&&$clone(a,E.Value).CanInterface()){$s=1;continue;}$s=2;continue;case 1:e=$clone(a,E.Value).Interface();$s=3;case 3:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}d.arg=e;f=d.handleMethods(b);$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}if(f){$s=4;continue;}$s=5;continue;case 4:$s=-1;return;case 5:case 2:d.arg=$ifaceNil;d.value=a;g=a;h=$clone(a,E.Value).Kind();if(h===(0)){$s=8;continue;}if(h===(1)){$s=9;continue;}if((h===(2))||(h===(3))||(h===(4))||(h===(5))||(h===(6))){$s=10;continue;}if((h===(7))||(h===(8))||(h===(9))||(h===(10))||(h===(11))||(h===(12))){$s=11;continue;}if(h===(13)){$s=12;continue;}if(h===(14)){$s=13;continue;}if(h===(15)){$s=14;continue;}if(h===(16)){$s=15;continue;}if(h===(24)){$s=16;continue;}if(h===(21)){$s=17;continue;}if(h===(25)){$s=18;continue;}if(h===(20)){$s=19;continue;}if((h===(17))||(h===(23))){$s=20;continue;}if(h===(22)){$s=21;continue;}if((h===(18))||(h===(19))||(h===(26))){$s=22;continue;}$s=23;continue;case 8:if(c===0){$s=25;continue;}$s=26;continue;case 25:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("");$s=27;continue;case 26:i=b;if(i===(118)){$s=29;continue;}$s=30;continue;case 29:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("");$s=31;continue;case 30:$r=d.badVerb(b);$s=32;case 32:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 31:case 28:case 27:$s=24;continue;case 9:$r=d.fmtBool($clone(g,E.Value).Bool(),b);$s=33;case 33:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 10:$r=d.fmtInteger(((j=$clone(g,E.Value).Int(),new $Uint64(j.$high,j.$low))),true,b);$s=34;case 34:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 11:$r=d.fmtInteger($clone(g,E.Value).Uint(),false,b);$s=35;case 35:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 12:$r=d.fmtFloat($clone(g,E.Value).Float(),32,b);$s=36;case 36:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 13:$r=d.fmtFloat($clone(g,E.Value).Float(),64,b);$s=37;case 37:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 14:$r=d.fmtComplex($clone(g,E.Value).Complex(),64,b);$s=38;case 38:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 15:$r=d.fmtComplex($clone(g,E.Value).Complex(),128,b);$s=39;case 39:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 16:k=$clone(g,E.Value).String();$s=40;case 40:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}$r=d.fmtString(k,b);$s=41;case 41:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 17:if(d.fmt.fmtFlags.sharpV){$s=42;continue;}$s=43;continue;case 42:l=$clone(g,E.Value).Type().String();$s=45;case 45:if($c){$c=false;l=l.$blk();}if(l&&l.$blk!==undefined){break s;}$r=(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(l);$s=46;case 46:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if($clone(g,E.Value).IsNil()){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("(nil)");$s=-1;return;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(123);$s=44;continue;case 43:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("map[");case 44:m=I.Sort($clone(g,E.Value));$s=47;case 47:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}n=m;o=n.Key;p=0;case 48:if(!(p=o.$length)?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+p]);if(q>0){if(d.fmt.fmtFlags.sharpV){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(", ");}else{(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(32);}}$r=d.printValue($clone(r,E.Value),b,c+1>>0);$s=50;case 50:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(58);$r=d.printValue($clone((s=n.Value,((q<0||q>=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+q])),E.Value),b,c+1>>0);$s=51;case 51:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}p++;$s=48;continue;case 49:if(d.fmt.fmtFlags.sharpV){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(125);}else{(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(93);}$s=24;continue;case 18:if(d.fmt.fmtFlags.sharpV){$s=52;continue;}$s=53;continue;case 52:t=$clone(g,E.Value).Type().String();$s=54;case 54:if($c){$c=false;t=t.$blk();}if(t&&t.$blk!==undefined){break s;}$r=(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(t);$s=55;case 55:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 53:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(123);u=0;case 56:if(!(u<$clone(g,E.Value).NumField())){$s=57;continue;}if(u>0){if(d.fmt.fmtFlags.sharpV){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(", ");}else{(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(32);}}if(d.fmt.fmtFlags.plusV||d.fmt.fmtFlags.sharpV){$s=58;continue;}$s=59;continue;case 58:v=$clone(g,E.Value).Type().Field(u);$s=60;case 60:if($c){$c=false;v=v.$blk();}if(v&&v.$blk!==undefined){break s;}w=v.Name;if(!(w==="")){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(w);(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(58);}case 59:x=BB($clone(g,E.Value),u);$s=61;case 61:if($c){$c=false;x=x.$blk();}if(x&&x.$blk!==undefined){break s;}$r=d.printValue($clone(x,E.Value),b,c+1>>0);$s=62;case 62:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}u=u+(1)>>0;$s=56;continue;case 57:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(125);$s=24;continue;case 19:y=$clone(g,E.Value).Elem();$s=63;case 63:if($c){$c=false;y=y.$blk();}if(y&&y.$blk!==undefined){break s;}z=y;if(!$clone(z,E.Value).IsValid()){$s=64;continue;}$s=65;continue;case 64:if(d.fmt.fmtFlags.sharpV){$s=67;continue;}$s=68;continue;case 67:aa=$clone(g,E.Value).Type().String();$s=70;case 70:if($c){$c=false;aa=aa.$blk();}if(aa&&aa.$blk!==undefined){break s;}$r=(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(aa);$s=71;case 71:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("(nil)");$s=69;continue;case 68:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("");case 69:$s=66;continue;case 65:$r=d.printValue($clone(z,E.Value),b,c+1>>0);$s=72;case 72:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 66:$s=24;continue;case 20:ab=b;if((ab===(115))||(ab===(113))||(ab===(120))||(ab===(88))){$s=74;continue;}$s=75;continue;case 74:ac=$clone(g,E.Value).Type();ad=ac.Elem();$s=78;case 78:if($c){$c=false;ad=ad.$blk();}if(ad&&ad.$blk!==undefined){break s;}ae=ad.Kind();$s=79;case 79:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}if(ae===8){$s=76;continue;}$s=77;continue;case 76:af=BS.nil;if($clone(g,E.Value).Kind()===23){$s=80;continue;}if($clone(g,E.Value).CanAddr()){$s=81;continue;}$s=82;continue;case 80:ag=$clone(g,E.Value).Bytes();$s=84;case 84:if($c){$c=false;ag=ag.$blk();}if(ag&&ag.$blk!==undefined){break s;}af=ag;$s=83;continue;case 81:ah=$clone(g,E.Value).Slice(0,$clone(g,E.Value).Len());$s=85;case 85:if($c){$c=false;ah=ah.$blk();}if(ah&&ah.$blk!==undefined){break s;}ai=$clone(ah,E.Value).Bytes();$s=86;case 86:if($c){$c=false;ai=ai.$blk();}if(ai&&ai.$blk!==undefined){break s;}af=ai;$s=83;continue;case 82:af=$makeSlice(BS,$clone(g,E.Value).Len());aj=af;ak=0;case 87:if(!(ak=af.$length)?($throwRuntimeError("index out of range"),undefined):af.$array[af.$offset+al]=((an.$low<<24>>>24)));ak++;$s=87;continue;case 88:case 83:ao=af;ap=b;aq=ac.String();$s=91;case 91:if($c){$c=false;aq=aq.$blk();}if(aq&&aq.$blk!==undefined){break s;}ar=aq;$r=d.fmtBytes(ao,ap,ar);$s=92;case 92:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 77:case 75:case 73:if(d.fmt.fmtFlags.sharpV){$s=93;continue;}$s=94;continue;case 93:as=$clone(g,E.Value).Type().String();$s=96;case 96:if($c){$c=false;as=as.$blk();}if(as&&as.$blk!==undefined){break s;}$r=(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(as);$s=97;case 97:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(($clone(g,E.Value).Kind()===23)&&$clone(g,E.Value).IsNil()){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString("(nil)");$s=-1;return;}(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(123);at=0;case 98:if(!(at<$clone(g,E.Value).Len())){$s=99;continue;}if(at>0){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeString(", ");}au=$clone(g,E.Value).Index(at);$s=100;case 100:if($c){$c=false;au=au.$blk();}if(au&&au.$blk!==undefined){break s;}$r=d.printValue($clone(au,E.Value),b,c+1>>0);$s=101;case 101:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}at=at+(1)>>0;$s=98;continue;case 99:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(125);$s=95;continue;case 94:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(91);av=0;case 102:if(!(av<$clone(g,E.Value).Len())){$s=103;continue;}if(av>0){(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(32);}aw=$clone(g,E.Value).Index(av);$s=104;case 104:if($c){$c=false;aw=aw.$blk();}if(aw&&aw.$blk!==undefined){break s;}$r=d.printValue($clone(aw,E.Value),b,c+1>>0);$s=105;case 105:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}av=av+(1)>>0;$s=102;continue;case 103:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(93);case 95:$s=24;continue;case 21:if((c===0)&&!(($clone(g,E.Value).Pointer()===0))){$s=106;continue;}$s=107;continue;case 106:ax=$clone(g,E.Value).Elem();$s=109;case 109:if($c){$c=false;ax=ax.$blk();}if(ax&&ax.$blk!==undefined){break s;}ay=ax;az=$clone(ay,E.Value).Kind();if((az===(17))||(az===(23))||(az===(25))||(az===(21))){$s=110;continue;}$s=111;continue;case 110:(d.$ptr_buf||(d.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},d))).writeByte(38);$r=d.printValue($clone(ay,E.Value),b,c+1>>0);$s=112;case 112:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return;case 111:case 108:case 107:$r=d.fmtPointer($clone(g,E.Value),b);$s=113;case 113:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 22:$r=d.fmtPointer($clone(g,E.Value),b);$s=114;case 114:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=24;continue;case 23:$r=d.unknownType($clone(g,E.Value));$s=115;case 115:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}case 24:case 7:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.printValue,$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,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;};AP.prototype.printValue=function(a,b,c){return this.$val.printValue(a,b,c);};AP.ptr.prototype.doPrint=function(a){var{a,b,c,d,e,f,g,h,i,j,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=this;c=false;d=a;e=0;case 1:if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);if(!(!($interfaceIsEqual(g,$ifaceNil)))){h=false;$s=3;continue s;}i=E.TypeOf(g).Kind();$s=4;case 4:if($c){$c=false;i=i.$blk();}if(i&&i.$blk!==undefined){break s;}h=i===24;case 3:j=h;if(f>0&&!j&&!c){(b.$ptr_buf||(b.$ptr_buf=new BO(function(){return this.$target.buf;},function($v){this.$target.buf=$v;},b))).writeByte(32);}$r=b.printArg(g,118);$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}c=j;e++;$s=1;continue;case 2:$s=-1;return;}return;}var $f={$blk:AP.ptr.prototype.doPrint,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};AP.prototype.doPrint=function(a){return this.$val.doPrint(a);};BH.ptr.prototype.clearflags=function(){var a;a=this;BG.copy(a.fmtFlags,new BG.ptr(false,false,false,false,false,false,false,false,false));};BH.prototype.clearflags=function(){return this.$val.clearflags();};BH.ptr.prototype.init=function(a){var a,b;b=this;b.buf=a;b.clearflags();};BH.prototype.init=function(a){return this.$val.init(a);};BH.ptr.prototype.writePadding=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;if(a<=0){return;}c=b.buf.$get();d=c.$length;e=d+a>>0;if(e>c.$capacity){c=$makeSlice(AO,(($imul(c.$capacity,2))+a>>0));$copySlice(c,b.buf.$get());}f=32;if(b.fmtFlags.zero){f=48;}g=$subslice(c,d,e);h=g;i=0;while(true){if(!(i=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+j]=f);i++;}b.buf.$set($subslice(c,0,e));};BH.prototype.writePadding=function(a){return this.$val.writePadding(a);};BH.ptr.prototype.pad=function(a){var a,b,c;b=this;if(!b.fmtFlags.widPresent||(b.wid===0)){b.buf.write(a);return;}c=b.wid-H.RuneCount(a)>>0;if(!b.fmtFlags.minus){b.writePadding(c);b.buf.write(a);}else{b.buf.write(a);b.writePadding(c);}};BH.prototype.pad=function(a){return this.$val.pad(a);};BH.ptr.prototype.padString=function(a){var a,b,c;b=this;if(!b.fmtFlags.widPresent||(b.wid===0)){b.buf.writeString(a);return;}c=b.wid-H.RuneCountInString(a)>>0;if(!b.fmtFlags.minus){b.writePadding(c);b.buf.writeString(a);}else{b.buf.writeString(a);b.writePadding(c);}};BH.prototype.padString=function(a){return this.$val.padString(a);};BH.ptr.prototype.fmtBoolean=function(a){var a,b;b=this;if(a){b.padString("true");}else{b.padString("false");}};BH.prototype.fmtBoolean=function(a){return this.$val.fmtBoolean(a);};BH.ptr.prototype.fmtUnicode=function(a){var a,b,c,d,e,f,g;b=this;c=$subslice(new BS(b.intbuf),0);d=4;if(b.fmtFlags.precPresent&&b.prec>4){d=b.prec;e=(((2+d>>0)+2>>0)+4>>0)+1>>0;if(e>c.$length){c=$makeSlice(BS,e);}}f=c.$length;if(b.fmtFlags.sharp&&(a.$high<0||(a.$high===0&&a.$low<=1114111))&&F.IsPrint(((a.$low>>0)))){f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=39);f=f-(H.RuneLen(((a.$low>>0))))>>0;H.EncodeRune($subslice(c,f),((a.$low>>0)));f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=39);f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=32);}while(true){if(!((a.$high>0||(a.$high===0&&a.$low>=16)))){break;}f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]="0123456789ABCDEFX".charCodeAt($flatten64(new $Uint64(a.$high&0,(a.$low&15)>>>0))));d=d-(1)>>0;a=$shiftRightUint64(a,(4));}f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]="0123456789ABCDEFX".charCodeAt($flatten64(a)));d=d-(1)>>0;while(true){if(!(d>0)){break;}f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=48);d=d-(1)>>0;}f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=43);f=f-(1)>>0;((f<0||f>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+f]=85);g=b.fmtFlags.zero;b.fmtFlags.zero=false;b.pad($subslice(c,f));b.fmtFlags.zero=g;};BH.prototype.fmtUnicode=function(a){return this.$val.fmtUnicode(a);};BH.ptr.prototype.fmtInteger=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;f=this;h=c&&(g=(new $Int64(a.$high,a.$low)),(g.$high<0||(g.$high===0&&g.$low<0)));if(h){a=new $Uint64(-a.$high,-a.$low);}i=$subslice(new BS(f.intbuf),0);if(f.fmtFlags.widPresent||f.fmtFlags.precPresent){j=(3+f.wid>>0)+f.prec>>0;if(j>i.$length){i=$makeSlice(BS,j);}}k=0;if(f.fmtFlags.precPresent){k=f.prec;if((k===0)&&(a.$high===0&&a.$low===0)){l=f.fmtFlags.zero;f.fmtFlags.zero=false;f.writePadding(f.wid);f.fmtFlags.zero=l;return;}}else if(f.fmtFlags.zero&&f.fmtFlags.widPresent){k=f.wid;if(h||f.fmtFlags.plus||f.fmtFlags.space){k=k-(1)>>0;}}m=i.$length;n=b;if(n===(10)){while(true){if(!((a.$high>0||(a.$high===0&&a.$low>=10)))){break;}m=m-(1)>>0;o=$div64(a,new $Uint64(0,10),false);((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=(((p=new $Uint64(0+a.$high,48+a.$low),q=$mul64(o,new $Uint64(0,10)),new $Uint64(p.$high-q.$high,p.$low-q.$low)).$low<<24>>>24)));a=o;}}else if(n===(16)){while(true){if(!((a.$high>0||(a.$high===0&&a.$low>=16)))){break;}m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=e.charCodeAt($flatten64(new $Uint64(a.$high&0,(a.$low&15)>>>0))));a=$shiftRightUint64(a,(4));}}else if(n===(8)){while(true){if(!((a.$high>0||(a.$high===0&&a.$low>=8)))){break;}m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=(((r=new $Uint64(a.$high&0,(a.$low&7)>>>0),new $Uint64(0+r.$high,48+r.$low)).$low<<24>>>24)));a=$shiftRightUint64(a,(3));}}else if(n===(2)){while(true){if(!((a.$high>0||(a.$high===0&&a.$low>=2)))){break;}m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=(((s=new $Uint64(a.$high&0,(a.$low&1)>>>0),new $Uint64(0+s.$high,48+s.$low)).$low<<24>>>24)));a=$shiftRightUint64(a,(1));}}else{$panic(new $String("fmt: unknown base; can't happen"));}m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=e.charCodeAt($flatten64(a)));while(true){if(!(m>0&&k>(i.$length-m>>0))){break;}m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=48);}if(f.fmtFlags.sharp){t=b;if(t===(2)){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=98);m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=48);}else if(t===(8)){if(!((((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m])===48))){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=48);}}else if(t===(16)){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=e.charCodeAt(16));m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=48);}}if(d===79){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=111);m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=48);}if(h){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=45);}else if(f.fmtFlags.plus){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=43);}else if(f.fmtFlags.space){m=m-(1)>>0;((m<0||m>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+m]=32);}u=f.fmtFlags.zero;f.fmtFlags.zero=false;f.pad($subslice(i,m));f.fmtFlags.zero=u;};BH.prototype.fmtInteger=function(a,b,c,d,e){return this.$val.fmtInteger(a,b,c,d,e);};BH.ptr.prototype.truncateString=function(a){var a,b,c,d,e,f,g;b=this;if(b.fmtFlags.precPresent){c=b.prec;d=a;e=0;while(true){if(!(e>0;if(c<0){return $substring(a,0,g);}e+=f[1];}}return a;};BH.prototype.truncateString=function(a){return this.$val.truncateString(a);};BH.ptr.prototype.truncate=function(a){var a,b,c,d,e,f;b=this;if(b.fmtFlags.precPresent){c=b.prec;d=0;while(true){if(!(d>0;if(c<0){return $subslice(a,0,d);}e=1;if(((d<0||d>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+d])>=128){f=H.DecodeRune($subslice(a,d));e=f[1];}d=d+(e)>>0;}}return a;};BH.prototype.truncate=function(a){return this.$val.truncate(a);};BH.ptr.prototype.fmtS=function(a){var a,b;b=this;a=b.truncateString(a);b.padString(a);};BH.prototype.fmtS=function(a){return this.$val.fmtS(a);};BH.ptr.prototype.fmtBs=function(a){var a,b;b=this;a=b.truncate(a);b.pad(a);};BH.prototype.fmtBs=function(a){return this.$val.fmtBs(a);};BH.ptr.prototype.fmtSbx=function(a,b,c){var a,b,c,d,e,f,g,h,i;d=this;e=b.$length;if(b===BS.nil){e=a.length;}if(d.fmtFlags.precPresent&&d.prec0){if(d.fmtFlags.space){if(d.fmtFlags.sharp){f=$imul(f,(2));}f=f+((e-1>>0))>>0;}else if(d.fmtFlags.sharp){f=f+(2)>>0;}}else{if(d.fmtFlags.widPresent){d.writePadding(d.wid);}return;}if(d.fmtFlags.widPresent&&d.wid>f&&!d.fmtFlags.minus){d.writePadding(d.wid-f>>0);}g=d.buf.$get();if(d.fmtFlags.sharp){g=$append(g,48,c.charCodeAt(16));}h=0;i=0;while(true){if(!(i0){g=$append(g,32);if(d.fmtFlags.sharp){g=$append(g,48,c.charCodeAt(16));}}if(!(b===BS.nil)){h=((i<0||i>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+i]);}else{h=a.charCodeAt(i);}g=$append(g,c.charCodeAt((h>>>4<<24>>>24)),c.charCodeAt(((h&15)>>>0)));i=i+(1)>>0;}d.buf.$set(g);if(d.fmtFlags.widPresent&&d.wid>f&&d.fmtFlags.minus){d.writePadding(d.wid-f>>0);}};BH.prototype.fmtSbx=function(a,b,c){return this.$val.fmtSbx(a,b,c);};BH.ptr.prototype.fmtSx=function(a,b){var a,b,c;c=this;c.fmtSbx(a,BS.nil,b);};BH.prototype.fmtSx=function(a,b){return this.$val.fmtSx(a,b);};BH.ptr.prototype.fmtBx=function(a,b){var a,b,c;c=this;c.fmtSbx("",a,b);};BH.prototype.fmtBx=function(a,b){return this.$val.fmtBx(a,b);};BH.ptr.prototype.fmtQ=function(a){var a,b,c;b=this;a=b.truncateString(a);if(b.fmtFlags.sharp&&F.CanBackquote(a)){b.padString("`"+a+"`");return;}c=$subslice(new BS(b.intbuf),0,0);if(b.fmtFlags.plus){b.pad(F.AppendQuoteToASCII(c,a));}else{b.pad(F.AppendQuote(c,a));}};BH.prototype.fmtQ=function(a){return this.$val.fmtQ(a);};BH.ptr.prototype.fmtC=function(a){var a,b,c,d,e;b=this;c=((a.$low>>0));if((a.$high>0||(a.$high===0&&a.$low>1114111))){c=65533;}d=$subslice(new BS(b.intbuf),0,0);e=H.EncodeRune($subslice(d,0,4),c);b.pad($subslice(d,0,e));};BH.prototype.fmtC=function(a){return this.$val.fmtC(a);};BH.ptr.prototype.fmtQc=function(a){var a,b,c,d;b=this;c=((a.$low>>0));if((a.$high>0||(a.$high===0&&a.$low>1114111))){c=65533;}d=$subslice(new BS(b.intbuf),0,0);if(b.fmtFlags.plus){b.pad(F.AppendQuoteRuneToASCII(d,c));}else{b.pad(F.AppendQuoteRune(d,c));}};BH.prototype.fmtQc=function(a){return this.$val.fmtQc(a);};BH.ptr.prototype.fmtFloat=function(a,b,c,d){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;e=this;if(e.fmtFlags.precPresent){d=e.prec;}f=F.AppendFloat($subslice(new BS(e.intbuf),0,1),a,((c<<24>>>24)),d,b);if(((1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])===45)||((1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])===43)){f=$subslice(f,1);}else{(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=43);}if(e.fmtFlags.space&&((0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])===43)&&!e.fmtFlags.plus){(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=32);}if(((1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])===73)||((1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])===78)){g=e.fmtFlags.zero;e.fmtFlags.zero=false;if(((1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])===78)&&!e.fmtFlags.space&&!e.fmtFlags.plus){f=$subslice(f,1);}e.pad(f);e.fmtFlags.zero=g;return;}if(e.fmtFlags.sharp&&!((c===98))){h=0;i=c;if((i===(118))||(i===(103))||(i===(71))||(i===(120))){h=d;if(h===-1){h=6;}}j=CP.zero();k=$subslice(new BS(j),0,0);l=false;m=false;n=1;while(true){if(!(n=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+n]);if(o===(46)){l=true;}else if((o===(112))||(o===(80))){k=$appendSlice(k,$subslice(f,n));f=$subslice(f,0,n);}else if((o===(101))||(o===(69))){if(!((c===120))&&!((c===88))){k=$appendSlice(k,$subslice(f,n));f=$subslice(f,0,n);break;}if(!((((n<0||n>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+n])===48))){m=true;}if(m){h=h-(1)>>0;}}else{if(!((((n<0||n>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+n])===48))){m=true;}if(m){h=h-(1)>>0;}}}n=n+(1)>>0;}if(!l){if((f.$length===2)&&((1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1])===48)){h=h-(1)>>0;}f=$append(f,46);}while(true){if(!(h>0)){break;}f=$append(f,48);h=h-(1)>>0;}f=$appendSlice(f,k);}if(e.fmtFlags.plus||!(((0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0])===43))){if(e.fmtFlags.zero&&e.fmtFlags.widPresent&&e.wid>f.$length){e.buf.writeByte((0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]));e.writePadding(e.wid-f.$length>>0);e.buf.write($subslice(f,1));return;}e.pad(f);return;}e.pad($subslice(f,1));};BH.prototype.fmtFloat=function(a,b,c,d){return this.$val.fmtFloat(a,b,c,d);};BT.methods=[{prop:"Read",name:"Read",pkg:"",typ:$funcType([BS],[$Int,$error],false)},{prop:"ReadRune",name:"ReadRune",pkg:"",typ:$funcType([],[$Int32,$Int,$error],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"getRune",name:"getRune",pkg:"fmt",typ:$funcType([],[$Int32],false)},{prop:"mustReadRune",name:"mustReadRune",pkg:"fmt",typ:$funcType([],[$Int32],false)},{prop:"UnreadRune",name:"UnreadRune",pkg:"",typ:$funcType([],[$error],false)},{prop:"error",name:"error",pkg:"fmt",typ:$funcType([$error],[],false)},{prop:"errorString",name:"errorString",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"Token",name:"Token",pkg:"",typ:$funcType([$Bool,CQ],[BS,$error],false)},{prop:"free",name:"free",pkg:"fmt",typ:$funcType([X],[],false)},{prop:"SkipSpace",name:"SkipSpace",pkg:"",typ:$funcType([],[],false)},{prop:"token",name:"token",pkg:"fmt",typ:$funcType([$Bool,CQ],[BS],false)},{prop:"consume",name:"consume",pkg:"fmt",typ:$funcType([$String,$Bool],[$Bool],false)},{prop:"peek",name:"peek",pkg:"fmt",typ:$funcType([$String],[$Bool],false)},{prop:"notEOF",name:"notEOF",pkg:"fmt",typ:$funcType([],[],false)},{prop:"accept",name:"accept",pkg:"fmt",typ:$funcType([$String],[$Bool],false)},{prop:"okVerb",name:"okVerb",pkg:"fmt",typ:$funcType([$Int32,$String,$String],[$Bool],false)},{prop:"scanBool",name:"scanBool",pkg:"fmt",typ:$funcType([$Int32],[$Bool],false)},{prop:"getBase",name:"getBase",pkg:"fmt",typ:$funcType([$Int32],[$Int,$String],false)},{prop:"scanNumber",name:"scanNumber",pkg:"fmt",typ:$funcType([$String,$Bool],[$String],false)},{prop:"scanRune",name:"scanRune",pkg:"fmt",typ:$funcType([$Int],[$Int64],false)},{prop:"scanBasePrefix",name:"scanBasePrefix",pkg:"fmt",typ:$funcType([],[$Int,$String,$Bool],false)},{prop:"scanInt",name:"scanInt",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Int64],false)},{prop:"scanUint",name:"scanUint",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Uint64],false)},{prop:"floatToken",name:"floatToken",pkg:"fmt",typ:$funcType([],[$String],false)},{prop:"complexTokens",name:"complexTokens",pkg:"fmt",typ:$funcType([],[$String,$String],false)},{prop:"convertFloat",name:"convertFloat",pkg:"fmt",typ:$funcType([$String,$Int],[$Float64],false)},{prop:"scanComplex",name:"scanComplex",pkg:"fmt",typ:$funcType([$Int32,$Int],[$Complex128],false)},{prop:"convertString",name:"convertString",pkg:"fmt",typ:$funcType([$Int32],[$String],false)},{prop:"quotedString",name:"quotedString",pkg:"fmt",typ:$funcType([],[$String],false)},{prop:"hexByte",name:"hexByte",pkg:"fmt",typ:$funcType([],[$Uint8,$Bool],false)},{prop:"hexString",name:"hexString",pkg:"fmt",typ:$funcType([],[$String],false)},{prop:"scanPercent",name:"scanPercent",pkg:"fmt",typ:$funcType([],[],false)},{prop:"scanOne",name:"scanOne",pkg:"fmt",typ:$funcType([$Int32,$emptyInterface],[],false)},{prop:"doScan",name:"doScan",pkg:"fmt",typ:$funcType([BM],[$Int,$error],false)},{prop:"advance",name:"advance",pkg:"fmt",typ:$funcType([$String],[$Int],false)},{prop:"doScanf",name:"doScanf",pkg:"fmt",typ:$funcType([$String,BM],[$Int,$error],false)}];BO.methods=[{prop:"write",name:"write",pkg:"fmt",typ:$funcType([BS],[],false)},{prop:"writeString",name:"writeString",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"writeByte",name:"writeByte",pkg:"fmt",typ:$funcType([$Uint8],[],false)},{prop:"writeRune",name:"writeRune",pkg:"fmt",typ:$funcType([$Int32],[],false)}];CO.methods=[{prop:"free",name:"free",pkg:"fmt",typ:$funcType([],[],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Precision",name:"Precision",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Flag",name:"Flag",pkg:"",typ:$funcType([$Int],[$Bool],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([BS],[$Int,$error],false)},{prop:"WriteString",name:"WriteString",pkg:"",typ:$funcType([$String],[$Int,$error],false)},{prop:"unknownType",name:"unknownType",pkg:"fmt",typ:$funcType([E.Value],[],false)},{prop:"badVerb",name:"badVerb",pkg:"fmt",typ:$funcType([$Int32],[],false)},{prop:"fmtBool",name:"fmtBool",pkg:"fmt",typ:$funcType([$Bool,$Int32],[],false)},{prop:"fmt0x64",name:"fmt0x64",pkg:"fmt",typ:$funcType([$Uint64,$Bool],[],false)},{prop:"fmtInteger",name:"fmtInteger",pkg:"fmt",typ:$funcType([$Uint64,$Bool,$Int32],[],false)},{prop:"fmtFloat",name:"fmtFloat",pkg:"fmt",typ:$funcType([$Float64,$Int,$Int32],[],false)},{prop:"fmtComplex",name:"fmtComplex",pkg:"fmt",typ:$funcType([$Complex128,$Int,$Int32],[],false)},{prop:"fmtString",name:"fmtString",pkg:"fmt",typ:$funcType([$String,$Int32],[],false)},{prop:"fmtBytes",name:"fmtBytes",pkg:"fmt",typ:$funcType([BS,$Int32,$String],[],false)},{prop:"fmtPointer",name:"fmtPointer",pkg:"fmt",typ:$funcType([E.Value,$Int32],[],false)},{prop:"catchPanic",name:"catchPanic",pkg:"fmt",typ:$funcType([$emptyInterface,$Int32,$String],[],false)},{prop:"handleMethods",name:"handleMethods",pkg:"fmt",typ:$funcType([$Int32],[$Bool],false)},{prop:"printArg",name:"printArg",pkg:"fmt",typ:$funcType([$emptyInterface,$Int32],[],false)},{prop:"printValue",name:"printValue",pkg:"fmt",typ:$funcType([E.Value,$Int32,$Int],[],false)},{prop:"argNumber",name:"argNumber",pkg:"fmt",typ:$funcType([$Int,$String,$Int,$Int],[$Int,$Int,$Bool],false)},{prop:"badArgNum",name:"badArgNum",pkg:"fmt",typ:$funcType([$Int32],[],false)},{prop:"missingArg",name:"missingArg",pkg:"fmt",typ:$funcType([$Int32],[],false)},{prop:"doPrintf",name:"doPrintf",pkg:"fmt",typ:$funcType([$String,BM],[],false)},{prop:"doPrint",name:"doPrint",pkg:"fmt",typ:$funcType([BM],[],false)},{prop:"doPrintln",name:"doPrintln",pkg:"fmt",typ:$funcType([BM],[],false)}];CS.methods=[{prop:"clearflags",name:"clearflags",pkg:"fmt",typ:$funcType([],[],false)},{prop:"init",name:"init",pkg:"fmt",typ:$funcType([BO],[],false)},{prop:"writePadding",name:"writePadding",pkg:"fmt",typ:$funcType([$Int],[],false)},{prop:"pad",name:"pad",pkg:"fmt",typ:$funcType([BS],[],false)},{prop:"padString",name:"padString",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"fmtBoolean",name:"fmtBoolean",pkg:"fmt",typ:$funcType([$Bool],[],false)},{prop:"fmtUnicode",name:"fmtUnicode",pkg:"fmt",typ:$funcType([$Uint64],[],false)},{prop:"fmtInteger",name:"fmtInteger",pkg:"fmt",typ:$funcType([$Uint64,$Int,$Bool,$Int32,$String],[],false)},{prop:"truncateString",name:"truncateString",pkg:"fmt",typ:$funcType([$String],[$String],false)},{prop:"truncate",name:"truncate",pkg:"fmt",typ:$funcType([BS],[BS],false)},{prop:"fmtS",name:"fmtS",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"fmtBs",name:"fmtBs",pkg:"fmt",typ:$funcType([BS],[],false)},{prop:"fmtSbx",name:"fmtSbx",pkg:"fmt",typ:$funcType([$String,BS,$String],[],false)},{prop:"fmtSx",name:"fmtSx",pkg:"fmt",typ:$funcType([$String,$String],[],false)},{prop:"fmtBx",name:"fmtBx",pkg:"fmt",typ:$funcType([BS,$String],[],false)},{prop:"fmtQ",name:"fmtQ",pkg:"fmt",typ:$funcType([$String],[],false)},{prop:"fmtC",name:"fmtC",pkg:"fmt",typ:$funcType([$Uint64],[],false)},{prop:"fmtQc",name:"fmtQc",pkg:"fmt",typ:$funcType([$Uint64],[],false)},{prop:"fmtFloat",name:"fmtFloat",pkg:"fmt",typ:$funcType([$Float64,$Int,$Int32,$Int],[],false)}];V.init("fmt",[{prop:"err",name:"err",embedded:false,exported:false,typ:$error,tag:""}]);W.init("fmt",[{prop:"rs",name:"rs",embedded:false,exported:false,typ:B.RuneScanner,tag:""},{prop:"buf",name:"buf",embedded:false,exported:false,typ:AO,tag:""},{prop:"count",name:"count",embedded:false,exported:false,typ:$Int,tag:""},{prop:"atEOF",name:"atEOF",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"ssave",name:"ssave",embedded:true,exported:false,typ:X,tag:""}]);X.init("fmt",[{prop:"validSave",name:"validSave",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"nlIsEnd",name:"nlIsEnd",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"nlIsSpace",name:"nlIsSpace",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"argLimit",name:"argLimit",embedded:false,exported:false,typ:$Int,tag:""},{prop:"limit",name:"limit",embedded:false,exported:false,typ:$Int,tag:""},{prop:"maxWid",name:"maxWid",embedded:false,exported:false,typ:$Int,tag:""}]);AK.init([{prop:"Flag",name:"Flag",pkg:"",typ:$funcType([$Int],[$Bool],false)},{prop:"Precision",name:"Precision",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int,$Bool],false)},{prop:"Write",name:"Write",pkg:"",typ:$funcType([BS],[$Int,$error],false)}]);AL.init([{prop:"Format",name:"Format",pkg:"",typ:$funcType([AK,$Int32],[],false)}]);AM.init([{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)}]);AN.init([{prop:"GoString",name:"GoString",pkg:"",typ:$funcType([],[$String],false)}]);AO.init($Uint8);AP.init("fmt",[{prop:"buf",name:"buf",embedded:false,exported:false,typ:AO,tag:""},{prop:"arg",name:"arg",embedded:false,exported:false,typ:$emptyInterface,tag:""},{prop:"value",name:"value",embedded:false,exported:false,typ:E.Value,tag:""},{prop:"fmt",name:"fmt",embedded:false,exported:false,typ:BH,tag:""},{prop:"reordered",name:"reordered",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"goodArgNum",name:"goodArgNum",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"panicking",name:"panicking",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"erroring",name:"erroring",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"wrapErrs",name:"wrapErrs",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"wrappedErr",name:"wrappedErr",embedded:false,exported:false,typ:$error,tag:""}]);BG.init("fmt",[{prop:"widPresent",name:"widPresent",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"precPresent",name:"precPresent",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"minus",name:"minus",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"plus",name:"plus",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"sharp",name:"sharp",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"space",name:"space",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"zero",name:"zero",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"plusV",name:"plusV",embedded:false,exported:false,typ:$Bool,tag:""},{prop:"sharpV",name:"sharpV",embedded:false,exported:false,typ:$Bool,tag:""}]);BH.init("fmt",[{prop:"buf",name:"buf",embedded:false,exported:false,typ:BO,tag:""},{prop:"fmtFlags",name:"fmtFlags",embedded:true,exported:false,typ:BG,tag:""},{prop:"wid",name:"wid",embedded:false,exported:false,typ:$Int,tag:""},{prop:"prec",name:"prec",embedded:false,exported:false,typ:$Int,tag:""},{prop:"intbuf",name:"intbuf",embedded:false,exported:false,typ:BP,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=I.$init();$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=B.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=C.$init();$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=D.$init();$s=5;case 5:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=E.$init();$s=6;case 6:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=F.$init();$s=7;case 7:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=G.$init();$s=8;case 8:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$r=H.$init();$s=9;case 9:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}Y=new BL([$toNativeArray($kindUint16,[9,13]),$toNativeArray($kindUint16,[32,32]),$toNativeArray($kindUint16,[133,133]),$toNativeArray($kindUint16,[160,160]),$toNativeArray($kindUint16,[5760,5760]),$toNativeArray($kindUint16,[8192,8202]),$toNativeArray($kindUint16,[8232,8233]),$toNativeArray($kindUint16,[8239,8239]),$toNativeArray($kindUint16,[8287,8287]),$toNativeArray($kindUint16,[12288,12288])]);AC=new G.Pool.ptr(BM.nil,(function(){return new W.ptr($ifaceNil,AO.nil,0,false,new X.ptr(false,false,false,0,0,0));}));AE=A.New("syntax error scanning complex number");AF=A.New("syntax error scanning boolean");AQ=new G.Pool.ptr(BM.nil,(function(){return new AP.ptr(AO.nil,$ifaceNil,new E.Value.ptr(BN.nil,0,0),new BH.ptr(BO.nil,new BG.ptr(false,false,false,false,false,false,false,false,false),0,0,BP.zero()),false,false,false,false,false,$ifaceNil);}));}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["github.com/kvartborg/vector"]=(function(){var $pkg={},$init,A,B,C,D,E,R,S,T,U,M,P,Q;A=$packages["errors"];B=$packages["fmt"];C=$packages["math"];D=$pkg.Vector=$newType(12,$kindSlice,"vector.Vector",true,"github.com/kvartborg/vector",true,null);E=$pkg.Axis=$newType(4,$kindInt,"vector.Axis",true,"github.com/kvartborg/vector",true,null);R=$sliceType($Float64);S=$sliceType($emptyInterface);T=$sliceType(D);U=$sliceType(E);D.prototype.Clone=function(){var a,b;a=this;b=$makeSlice(D,a.$length);$copySlice(b,a);return b;};$ptrType(D).prototype.Clone=function(){return this.$get().Clone();};D.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){P($convertSliceType(b,R),1,$convertSliceType(b,R),$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),R));}else{P($convertSliceType(b,R),1,$convertSliceType(b,R),$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),R));}e++;}return b;};$ptrType(D).prototype.Add=function(a){return this.$get().Add(a);};D.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){P($convertSliceType(b,R),-1,$convertSliceType($subslice(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),0,c),R),$convertSliceType(b,R));}else{P($convertSliceType(b,R),-1,$convertSliceType(((f<0||f>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+f]),R),$convertSliceType(b,R));}e++;}return b;};$ptrType(D).prototype.Sub=function(a){return this.$get().Sub(a);};D.prototype.Scale=function(a){var a,b;b=this;Q($convertSliceType(b,R),a,$convertSliceType(b,R));return b;};$ptrType(D).prototype.Scale=function(a){return this.$get().Scale(a);};D.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(D).prototype.Equal=function(a){return this.$get().Equal(a);};D.prototype.Magnitude=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 C.Sqrt(b);};$ptrType(D).prototype.Magnitude=function(){return this.$get().Magnitude();};D.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(D).prototype.Unit=function(){return this.$get().Unit();};M=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(D,(g-h>>0)),R));}if(g>0)),R));}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=M;D.prototype.Dot=function(a){var a,b;b=this;return M(b,a);};$ptrType(D).prototype.Dot=function(a){return this.$get().Dot(a);};D.prototype.Cross=function(a){var a,b;b=this;if(!((b.$length===3))||!((a.$length===3))){return[D.nil,$pkg.ErrNot3Dimensional];}return[new D([(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])]),$ifaceNil];};$ptrType(D).prototype.Cross=function(a){return this.$get().Cross(a);};D.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=C.Cos(a);m=C.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(D).prototype.Rotate=function(a,b){return this.$get().Rotate(a,b);};D.prototype.String=function(){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{});$s=$s||0;s:while(true){switch($s){case 0:a="";b=this;if(b===D.nil){a="[]";$s=-1;return a;}c=b;d=0;case 1:if(!(d=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])<1e-08&&((e<0||e>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e])>0){$s=3;continue;}$s=4;continue;case 3:a=a+("0 ");$s=5;continue;case 4:f=B.Sprint(new S([new $Float64(((e<0||e>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+e]))]));$s=6;case 6:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}a=a+(f+" ");case 5:d++;$s=1;continue;case 2:a="["+$substring(a,0,(a.length-1>>0))+"]";$s=-1;return a;}return;}var $f={$blk:D.prototype.String,$c:true,$r,a,b,c,d,e,f,$s};return $f;};$ptrType(D).prototype.String=function(){return this.$get().String();};D.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(D).prototype.X=function(){return this.$get().X();};D.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(D).prototype.Y=function(){return this.$get().Y();};D.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(D).prototype.Z=function(){return this.$get().Z();};P=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++;}};Q=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++;}};D.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[D],false)},{prop:"Add",name:"Add",pkg:"",typ:$funcType([T],[D],true)},{prop:"Sub",name:"Sub",pkg:"",typ:$funcType([T],[D],true)},{prop:"Scale",name:"Scale",pkg:"",typ:$funcType([$Float64],[D],false)},{prop:"Equal",name:"Equal",pkg:"",typ:$funcType([D],[$Bool],false)},{prop:"Magnitude",name:"Magnitude",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Unit",name:"Unit",pkg:"",typ:$funcType([],[D],false)},{prop:"Dot",name:"Dot",pkg:"",typ:$funcType([D],[$Float64],false)},{prop:"Cross",name:"Cross",pkg:"",typ:$funcType([D],[D,$error],false)},{prop:"Rotate",name:"Rotate",pkg:"",typ:$funcType([$Float64,U],[D],true)},{prop:"String",name:"String",pkg:"",typ:$funcType([],[$String],false)},{prop:"X",name:"X",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Y",name:"Y",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Z",name:"Z",pkg:"",typ:$funcType([],[$Float64],false)}];D.init($Float64);$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;}$pkg.ErrNot3Dimensional=A.New("vector is not 3 dimensional");}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); $packages["github.com/solarlune/resolv"]=(function(){var $pkg={},$init,B,A,C,D,F,G,I,K,N,P,Q,S,U,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,E,H,J,L,M,O,R,T,V;B=$packages["github.com/kvartborg/vector"];A=$packages["math"];C=$packages["sort"];D=$pkg.Space=$newType(0,$kindStruct,"resolv.Space",true,"github.com/solarlune/resolv",true,function(Cells_,CellWidth_,CellHeight_){this.$val=this;if(arguments.length===0){this.Cells=Y.nil;this.CellWidth=0;this.CellHeight=0;return;}this.Cells=Cells_;this.CellWidth=CellWidth_;this.CellHeight=CellHeight_;});F=$pkg.Shape=$newType(8,$kindInterface,"resolv.Shape",true,"github.com/solarlune/resolv",true,null);G=$pkg.Line=$newType(0,$kindStruct,"resolv.Line",true,"github.com/solarlune/resolv",true,function(Start_,End_){this.$val=this;if(arguments.length===0){this.Start=B.Vector.nil;this.End=B.Vector.nil;return;}this.Start=Start_;this.End=End_;});I=$pkg.ConvexPolygon=$newType(0,$kindStruct,"resolv.ConvexPolygon",true,"github.com/solarlune/resolv",true,function(Points_,X_,Y_,Closed_){this.$val=this;if(arguments.length===0){this.Points=AC.nil;this.X=0;this.Y=0;this.Closed=false;return;}this.Points=Points_;this.X=X_;this.Y=Y_;this.Closed=Closed_;});K=$pkg.ContactSet=$newType(0,$kindStruct,"resolv.ContactSet",true,"github.com/solarlune/resolv",true,function(Points_,MTV_,Center_){this.$val=this;if(arguments.length===0){this.Points=AC.nil;this.MTV=B.Vector.nil;this.Center=B.Vector.nil;return;}this.Points=Points_;this.MTV=MTV_;this.Center=Center_;});N=$pkg.Circle=$newType(0,$kindStruct,"resolv.Circle",true,"github.com/solarlune/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_;});P=$pkg.Projection=$newType(0,$kindStruct,"resolv.Projection",true,"github.com/solarlune/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_;});Q=$pkg.Object=$newType(0,$kindStruct,"resolv.Object",true,"github.com/solarlune/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=Z.nil;this.X=0;this.Y=0;this.W=0;this.H=0;this.TouchingCells=X.nil;this.Data=$ifaceNil;this.ignoreList=false;this.tags=AJ.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_;});S=$pkg.Collision=$newType(0,$kindStruct,"resolv.Collision",true,"github.com/solarlune/resolv",true,function(checkingObject_,dx_,dy_,Objects_,Cells_){this.$val=this;if(arguments.length===0){this.checkingObject=AA.nil;this.dx=0;this.dy=0;this.Objects=AB.nil;this.Cells=X.nil;return;}this.checkingObject=checkingObject_;this.dx=dx_;this.dy=dy_;this.Objects=Objects_;this.Cells=Cells_;});U=$pkg.Cell=$newType(0,$kindStruct,"resolv.Cell",true,"github.com/solarlune/resolv",true,function(X_,Y_,Objects_){this.$val=this;if(arguments.length===0){this.X=0;this.Y=0;this.Objects=AB.nil;return;}this.X=X_;this.Y=Y_;this.Objects=Objects_;});W=$ptrType(U);X=$sliceType(W);Y=$sliceType(X);Z=$ptrType(D);AA=$ptrType(Q);AB=$sliceType(AA);AC=$sliceType(B.Vector);AD=$sliceType($Float64);AE=$ptrType(G);AF=$sliceType(AE);AG=$ptrType(N);AH=$ptrType(I);AI=$ptrType(K);AJ=$sliceType($String);AK=$ptrType(S);AL=$mapType(AA,$Bool);E=function(a,b,c,d){var a,b,c,d,e,f,g;e=new D.ptr(Y.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=E;D.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;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:D.ptr.prototype.Add,$c:true,$r,a,b,c,d,e,$s};return $f;};D.prototype.Add=function(a){return this.$val.Add(a);};D.ptr.prototype.Remove=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=e.TouchingCells;g=0;while(true){if(!(g=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+g]);h.unregister(e);g++;}e.TouchingCells=new X([]);e.Space=Z.nil;d++;}};D.prototype.Remove=function(a){return this.$val.Remove(a);};D.ptr.prototype.Objects=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;a=this;b=$makeMap(AA.keyFor,[]);c=new AB([]);d=a.Cells;e=0;while(true){if(!(e=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+f]));i=0;while(true){if(!(i=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+f])),((j<0||j>=l.$length)?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+j])).Objects;n=0;while(true){if(!(n=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+n]);p=(q=b[AA.keyFor(o)],q!==undefined?[q.v,true]:[false,false]);r=p[1];if(!r){c=$append(c,o);s=o;(b||$throwRuntimeError("assignment to entry in nil map"))[AA.keyFor(s)]={k:s,v:true};}n++;}i++;}e++;}return c;};D.prototype.Objects=function(){return this.$val.Objects();};D.ptr.prototype.Resize=function(a,b){var a,b,c,d,e,f,g;c=this;c.Cells=new Y([]);d=0;while(true){if(!(d=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+d]=$append((f=c.Cells,((d<0||d>=f.$length)?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+d])),V(e,d))));e=e+(1)>>0;}d=d+(1)>>0;}};D.prototype.Resize=function(a,b){return this.$val.Resize(a,b);};D.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 W.nil;};D.prototype.Cell=function(a,b){return this.$val.Cell(a,b);};D.ptr.prototype.CheckCells=function(a,b,c,d,e){var a,b,c,d,e,f,g,h,i,j,k,l,m;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===W.nil)){if(e.$length>0){if(i.ContainsTags(e)){j=i.Objects;k=0;while(true){if(!(k=j.$length)?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+k]);if(l.HasTags(e)){return l;}k++;}}}else if(i.Occupied()){return(m=i.Objects,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0]));}}h=h+(1)>>0;}g=g+(1)>>0;}return AA.nil;};D.prototype.CheckCells=function(a,b,c,d,e){return this.$val.CheckCells(a,b,c,d,e);};D.ptr.prototype.UnregisterAllObjects=function(){var a,b,c,d,e,f,g;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]));a.Remove(g.Objects);c=c+(1)>>0;}b=b+(1)>>0;}};D.prototype.UnregisterAllObjects=function(){return this.$val.UnregisterAllObjects();};D.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];};D.prototype.WorldToSpace=function(a,b){return this.$val.WorldToSpace(a,b);};D.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];};D.prototype.SpaceToWorld=function(a,b){return this.$val.SpaceToWorld(a,b);};D.ptr.prototype.Height=function(){var a;a=this;return a.Cells.$length;};D.prototype.Height=function(){return this.$val.Height();};D.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;};D.prototype.Width=function(){return this.$val.Width();};D.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 X([]);g=e.Cell(a,b);h=e.Cell(c,d);if(!(g===W.nil)&&!(h===W.nil)){i=new B.Vector([((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.Vector([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===W.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;};D.prototype.CellsInLine=function(a,b,c,d){return this.$val.CellsInLine(a,b,c,d);};H=function(a,b,c,d){var a,b,c,d;return new G.ptr(new B.Vector([a,b]),new B.Vector([c,d]));};$pkg.NewLine=H;G.ptr.prototype.Project=function(a){var a,b;b=this;return b.Vector().Scale(a.Dot(b.Start.Sub(new AC([b.End]))));};G.prototype.Project=function(a){return this.$val.Project(a);};G.ptr.prototype.Normal=function(){var a,b;a=this;b=a.Vector();return new B.Vector([(1>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+1]),-(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0])]).Unit();};G.prototype.Normal=function(){return this.$val.Normal();};G.ptr.prototype.Vector=function(){var a;a=this;return a.End.Clone().Sub(new AC([a.Start])).Unit();};G.prototype.Vector=function(){return this.$val.Vector();};G.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.Vector([(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.Vector.nil;};G.prototype.IntersectionPointsLine=function(a){return this.$val.IntersectionPointsLine(a);};G.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 AC([]);d=new B.Vector([a.X,a.Y]);e=b.Start.Sub(new AC([d]));f=b.End.Sub(new AC([d]));g=f.Sub(new AC([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.Vector([(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.Vector([(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.Vector([(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;};G.prototype.IntersectionPointsCircle=function(a){return this.$val.IntersectionPointsCircle(a);};J=function(a){var a,b;b=new I.ptr(new AC([]),0,0,true);b.AddPoints(a);return b;};$pkg.NewConvexPolygon=J;I.ptr.prototype.Clone=function(){var a,b,c,d,e,f;a=this;b=new AC([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Clone());d++;}f=J(AD.nil);f.X=a.X;f.Y=a.Y;f.AddPointsVec(b);f.Closed=a.Closed;return f;};I.prototype.Clone=function(){return this.$val.Clone();};I.ptr.prototype.AddPointsVec=function(a){var a,b;b=this;b.Points=$appendSlice(b.Points,a);};I.prototype.AddPointsVec=function(a){return this.$val.AddPointsVec(a);};I.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;}};I.prototype.AddPoints=function(a){return this.$val.AddPoints(a);};I.ptr.prototype.Lines=function(){var a,b,c,d,e,f,g,h,i,j;a=this;b=new AF([]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0]);g=e;h=f;if(d<(c.$length-1>>0)){h=(i=d+1>>0,((i<0||i>=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+i]));}else if(!a.Closed){break;}j=H((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]),(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]));b=$append(b,j);d=d+(1)>>0;}return b;};I.prototype.Lines=function(){return this.$val.Lines();};I.ptr.prototype.Transformed=function(){var a,b,c,d,e;a=this;b=new AC([]);c=a.Points;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,new B.Vector([(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0])+a.X,(1>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+1])+a.Y]));d++;}return b;};I.prototype.Transformed=function(){return this.$val.Transformed();};I.ptr.prototype.Bounds=function(){var a,b,c,d,e,f,g,h;a=this;b=a.Transformed();e=new B.Vector([(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];};I.prototype.Bounds=function(){return this.$val.Bounds();};I.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};I.prototype.Position=function(){return this.$val.Position();};I.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};I.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};I.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};I.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};I.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};I.prototype.Move=function(a,b){return this.$val.Move(a,b);};I.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};I.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};I.ptr.prototype.Center=function(){var a,b,c,d,e;a=this;b=new B.Vector([0,0]);c=a.Transformed();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b.Add(new AC([e]));d++;}(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])/((a.Transformed().$length)));(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])/((a.Transformed().$length)));return b;};I.prototype.Center=function(){return this.$val.Center();};I.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.Vector([(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 P.ptr(f,g);};I.prototype.Project=function(a){return this.$val.Project(a);};I.ptr.prototype.SATAxes=function(){var a,b,c,d,e;a=this;b=new AC([]);c=a.Lines();d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);b=$append(b,e.Normal());d++;}return b;};I.prototype.SATAxes=function(){return this.$val.SATAxes();};I.ptr.prototype.PointInside=function(a){var a,b,c,d,e,f,g;b=this;c=H((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.Vector.nil)){d=d+(1)>>0;}f++;}return d===1;};I.prototype.PointInside=function(a){return this.$val.PointInside(a);};L=function(){return new K.ptr(new AC([]),new B.Vector([0,0]),new B.Vector([0,0]));};$pkg.NewContactSet=L;K.ptr.prototype.LeftmostPoint=function(){var a,b,c,d,e;a=this;b=B.Vector.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.Vector.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;};K.prototype.LeftmostPoint=function(){return this.$val.LeftmostPoint();};K.ptr.prototype.RightmostPoint=function(){var a,b,c,d,e;a=this;b=B.Vector.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.Vector.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;};K.prototype.RightmostPoint=function(){return this.$val.RightmostPoint();};K.ptr.prototype.TopmostPoint=function(){var a,b,c,d,e;a=this;b=B.Vector.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.Vector.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;};K.prototype.TopmostPoint=function(){return this.$val.TopmostPoint();};K.ptr.prototype.BottommostPoint=function(){var a,b,c,d,e;a=this;b=B.Vector.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.Vector.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;};K.prototype.BottommostPoint=function(){return this.$val.BottommostPoint();};I.ptr.prototype.Intersection=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,ag,ah,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});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=L();f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=$assertType(c,AG,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,AH,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.Vector.nil)){e.Points=$append(e.Points,w);}u++;}r++;}}}if(e.Points.$length>0){$s=1;continue;}$s=2;continue;case 1: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 AC([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);$s=4;case 4:if($c){$c=false;ae=ae.$blk();}if(ae&&ae.$blk!==undefined){break s;}af=ae;if(!(af===B.Vector.nil)){e.MTV=af;}$s=3;continue;case 2:e=AI.nil;case 3:if(!(e===AI.nil)&&(!((a===0))||!((b===0)))){ag=new B.Vector([a,b]).Magnitude();ah=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(ah-ag);}d.X=f;d.Y=g;$s=-1;return e;}return;}var $f={$blk:I.ptr.prototype.Intersection,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,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;};I.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};I.ptr.prototype.calculateMTV=function(a,b){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=[c];d=[d];e=this;f=new B.Vector([0,0]);g=new B.Vector([1.7976931348623157e+308,0]);h=b;if($assertType(h,AH,true)[1]){$s=1;continue;}if($assertType(h,AG,true)[1]){$s=2;continue;}$s=3;continue;case 1:i=h.$val;k=e.SATAxes();l=0;while(true){if(!(l=k.$length)?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+l]);if(!$clone(e.Project(m),P).Overlapping($clone(i.Project(m),P))){$s=-1;return B.Vector.nil;}n=$clone(e.Project(m),P).Overlap($clone(i.Project(m),P));if(g.Magnitude()>n){g=m.Scale(n);}l++;}o=i.SATAxes();p=0;while(true){if(!(p=o.$length)?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+p]);if(!$clone(e.Project(q),P).Overlapping($clone(i.Project(q),P))){$s=-1;return B.Vector.nil;}r=$clone(e.Project(q),P).Overlap($clone(i.Project(q),P));if(g.Magnitude()>r){g=q.Scale(r);}p++;}$s=3;continue;case 2:j=h.$val;d[0]=$appendSlice(new AC([]),e.Transformed());d[0]=$append(d[0],a.Center);c[0]=new B.Vector([j.X,j.Y]);$r=C.Slice(d[0],(function(c,d){return function(s,t){var s,t;return((s<0||s>=d[0].$length)?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+s]).Sub(new AC([c[0]])).Magnitude()<((t<0||t>=d[0].$length)?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+t]).Sub(new AC([c[0]])).Magnitude();};})(c,d));$s=4;case 4:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}g=new B.Vector([(0>=c[0].$length?($throwRuntimeError("index out of range"),undefined):c[0].$array[c[0].$offset+0])-(s=(0>=d[0].$length?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+0]),(0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])),(1>=c[0].$length?($throwRuntimeError("index out of range"),undefined):c[0].$array[c[0].$offset+1])-(t=(0>=d[0].$length?($throwRuntimeError("index out of range"),undefined):d[0].$array[d[0].$offset+0]),(1>=t.$length?($throwRuntimeError("index out of range"),undefined):t.$array[t.$offset+1]))]);g=g.Unit().Scale(g.Magnitude()-j.Radius);case 3:(0>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+0]=(0>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+0]));(1>=f.$length?($throwRuntimeError("index out of range"),undefined):f.$array[f.$offset+1]=(1>=g.$length?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+1]));$s=-1;return f;}return;}var $f={$blk:I.ptr.prototype.calculateMTV,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s};return $f;};I.prototype.calculateMTV=function(a,b){return this.$val.calculateMTV(a,b);};I.ptr.prototype.ContainedBy=function(a){var a,b,c,d,e,f,g,h,i,j;b=this;c=a;if($assertType(c,AH,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),P).IsInside($clone(d.Project(g),P))){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),P).IsInside($clone(d.Project(j),P))){return false;}i++;}}return true;};I.prototype.ContainedBy=function(a){return this.$val.ContainedBy(a);};I.ptr.prototype.FlipH=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]=-(0>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+0]));c++;}a.ReverseVertexOrder();};I.prototype.FlipH=function(){return this.$val.FlipH();};I.ptr.prototype.FlipV=function(){var a,b,c,d;a=this;b=a.Points;c=0;while(true){if(!(c=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+c]);(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]=-(1>=d.$length?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+1]));c++;}a.ReverseVertexOrder();};I.prototype.FlipV=function(){return this.$val.FlipV();};I.ptr.prototype.ReverseVertexOrder=function(){var a,b,c,d,e;a=this;c=new AC([(b=a.Points,(0>=b.$length?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+0]))]);d=a.Points.$length-1>>0;while(true){if(!(d>=1)){break;}c=$append(c,(e=a.Points,((d<0||d>=e.$length)?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+d])));d=d-(1)>>0;}a.Points=c;};I.prototype.ReverseVertexOrder=function(){return this.$val.ReverseVertexOrder();};M=function(a,b,c,d){var a,b,c,d;return J(new AD([a,b,a+c,b,a+c,b+d,a,b+d]));};$pkg.NewRectangle=M;O=function(a,b,c){var a,b,c,d;d=new N.ptr(a,b,c);return d;};$pkg.NewCircle=O;N.ptr.prototype.Clone=function(){var a;a=this;return O(a.X,a.Y,a.Radius);};N.prototype.Clone=function(){return this.$val.Clone();};N.ptr.prototype.Bounds=function(){var a;a=this;return[new B.Vector([a.X-a.Radius,a.Y-a.Radius]),new B.Vector([a.X+a.Radius,a.Y+a.Radius])];};N.prototype.Bounds=function(){return this.$val.Bounds();};N.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,s,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=this;e=AI.nil;f=d.X;g=d.Y;d.X=d.X+(a);d.Y=d.Y+(b);h=c;if($assertType(h,AH,true)[1]){$s=1;continue;}if($assertType(h,AG,true)[1]){$s=2;continue;}$s=3;continue;case 1:i=h.$val;k=i.Intersection(-a,-b,d);$s=4;case 4:if($c){$c=false;k=k.$blk();}if(k&&k.$blk!==undefined){break s;}e=k;if(!(e===AI.nil)){e.MTV=e.MTV.Scale(-1);}$s=3;continue;case 2:j=h.$val;e=L();e.Points=d.IntersectionPointsCircle(j);if(e.Points.$length===0){$s=-1;return AI.nil;}e.MTV=new B.Vector([d.X-j.X,d.Y-j.Y]);l=e.MTV.Magnitude();e.MTV=e.MTV.Unit().Scale(d.Radius+j.Radius-l);m=e.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);e.Center=e.Center.Add(new AC([o]));n++;}(q=e.Center,(0>=q.$length?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+0]=(p=e.Center,(0>=p.$length?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+0]))/((e.Points.$length))));(s=e.Center,(1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1]=(r=e.Center,(1>=r.$length?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+1]))/((e.Points.$length))));case 3:d.X=f;d.Y=g;$s=-1;return e;}return;}var $f={$blk:N.ptr.prototype.Intersection,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};N.prototype.Intersection=function(a,b,c){return this.$val.Intersection(a,b,c);};N.ptr.prototype.Move=function(a,b){var a,b,c;c=this;c.X=c.X+(a);c.Y=c.Y+(b);};N.prototype.Move=function(a,b){return this.$val.Move(a,b);};N.ptr.prototype.MoveVec=function(a){var a,b;b=this;b.X=b.X+(a.X());b.Y=b.Y+(a.Y());};N.prototype.MoveVec=function(a){return this.$val.MoveVec(a);};N.ptr.prototype.SetPosition=function(a,b){var a,b,c;c=this;c.X=a;c.Y=b;};N.prototype.SetPosition=function(a,b){return this.$val.SetPosition(a,b);};N.ptr.prototype.SetPositionVec=function(a){var a,b;b=this;b.X=a.X();b.Y=a.Y();};N.prototype.SetPositionVec=function(a){return this.$val.SetPositionVec(a);};N.ptr.prototype.Position=function(){var a;a=this;return[a.X,a.Y];};N.prototype.Position=function(){return this.$val.Position();};N.ptr.prototype.PointInside=function(a){var a,b;b=this;return a.Sub(new AC([new B.Vector([b.X,b.Y])])).Magnitude()<=b.Radius;};N.prototype.PointInside=function(a){return this.$val.PointInside(a);};N.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;};P.prototype.Overlapping=function(a){return this.$val.Overlapping(a);};P.ptr.prototype.Overlap=function(a){var a,b;b=this;return A.Min(b.Max,a.Max)-A.Max(b.Min,a.Min);};P.prototype.Overlap=function(a){return this.$val.Overlap(a);};P.ptr.prototype.IsInside=function(a){var a,b;b=this;return b.Min>=a.Min&&b.Max<=a.Max;};P.prototype.IsInside=function(a){return this.$val.IsInside(a);};R=function(a,b,c,d,e){var a,b,c,d,e,f;f=new Q.ptr($ifaceNil,Z.nil,a,b,c,d,X.nil,$ifaceNil,$makeMap(AA.keyFor,[]),new AJ([]));if(e.$length>0){f.AddTags(e);}return f;};$pkg.NewObject=R;Q.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=R(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:Q.ptr.prototype.Update,$c:true,$r,a,b,c,d,e,f,g,h,i,j,$s};return $f;};Q.prototype.Update=function(){return this.$val.Update();};Q.ptr.prototype.AddTags=function(a){var a,b;b=this;b.tags=$appendSlice(b.tags,a);};Q.prototype.AddTags=function(a){return this.$val.AddTags(a);};Q.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++;}};Q.prototype.RemoveTags=function(a){return this.$val.RemoveTags(a);};Q.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;};Q.prototype.HasTags=function(a){return this.$val.HasTags(a);};Q.ptr.prototype.Tags=function(){var a;a=this;return $appendSlice(new AJ([]),a.tags);};Q.prototype.Tags=function(){return this.$val.Tags();};Q.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:Q.ptr.prototype.SetShape,$c:true,$r,a,b,$s};return $f;};Q.prototype.SetShape=function(a){return this.$val.SetShape(a);};Q.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];};Q.prototype.BoundsToSpace=function(a,b){return this.$val.BoundsToSpace(a,b);};Q.ptr.prototype.SharesCells=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.Contains(a)){return true;}d++;}return false;};Q.prototype.SharesCells=function(a){return this.$val.SharesCells(a);};Q.ptr.prototype.SharesCellsTags=function(a){var a,b,c,d,e;b=this;c=b.TouchingCells;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.ContainsTags(a)){return true;}d++;}return false;};Q.prototype.SharesCellsTags=function(a){return this.$val.SharesCellsTags(a);};Q.ptr.prototype.Center=function(){var a;a=this;return[a.X+(a.W/2),a.Y+(a.H/2)];};Q.prototype.Center=function(){return this.$val.Center();};Q.ptr.prototype.SetCenter=function(a,b){var a,b,c;c=this;c.X=a-(c.W/2);c.Y=b-(c.H/2);};Q.prototype.SetCenter=function(a,b){return this.$val.SetCenter(a,b);};Q.ptr.prototype.CellPosition=function(){var a,b;a=this;b=a.Center();return a.Space.WorldToSpace(b[0],b[1]);};Q.prototype.CellPosition=function(){return this.$val.CellPosition();};Q.ptr.prototype.SetRight=function(a){var a,b;b=this;b.X=a-b.W;};Q.prototype.SetRight=function(a){return this.$val.SetRight(a);};Q.ptr.prototype.SetBottom=function(a){var a,b;b=this;b.Y=a-b.H;};Q.prototype.SetBottom=function(a){return this.$val.SetBottom(a);};Q.ptr.prototype.Bottom=function(){var a;a=this;return a.Y+a.H;};Q.prototype.Bottom=function(){return this.$val.Bottom();};Q.ptr.prototype.Right=function(){var a;a=this;return a.X+a.W;};Q.prototype.Right=function(){return this.$val.Right();};Q.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;};Q.prototype.SetBounds=function(a,b){return this.$val.SetBounds(a,b);};Q.ptr.prototype.Check=function(a,b,c){var{a,aa,ab,ac,ad,ae,af,ag,ah,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});$s=$s||0;s:while(true){switch($s){case 0:d=[d];e=[e];f=[f];g=[g];h=this;if(h.Space===Z.nil){$s=-1;return AK.nil;}d[0]=T();d[0].checkingObject=h;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);}d[0].dx=a;d[0].dy=b;i=h.BoundsToSpace(a,b);j=i[0];k=i[1];l=i[2];m=i[3];n=$makeMap(AA.keyFor,[]);o=$makeMap(W.keyFor,[]);p=k;while(true){if(!(p<=m)){break;}q=j;while(true){if(!(q<=l)){break;}r=h.Space.Cell(q,p);if(!(r===W.nil)){s=r.Objects;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);w=(v=h.ignoreList[AA.keyFor(u)],v!==undefined?v.v:false);if(u===h||w){t++;continue;}x=(y=n[AA.keyFor(u)],y!==undefined?[y.v,true]:[false,false]);z=x[1];if(((c.$length===0)||u.HasTags(c))&&!z){d[0].Objects=$append(d[0].Objects,u);aa=u;(n||$throwRuntimeError("assignment to entry in nil map"))[AA.keyFor(aa)]={k:aa,v:true};ab=(ac=o[W.keyFor(r)],ac!==undefined?[ac.v,true]:[false,false]);ad=ab[1];if(!ad){d[0].Cells=$append(d[0].Cells,r);ae=r;(o||$throwRuntimeError("assignment to entry in nil map"))[W.keyFor(ae)]={k:ae,v:true};}t++;continue;}t++;}}q=q+(1)>>0;}p=p+(1)>>0;}if(d[0].Objects.$length===0){$s=-1;return AK.nil;}af=d[0].checkingObject.Center();ag=af[0];ah=af[1];g[0]=new B.Vector([ag,ah]);$r=C.Slice(d[0].Objects,(function(d,e,f,g){return function(ai,aj){var ai,aj,ak,al,am,an,ao,ap,aq,ar;ak=(al=d[0].Objects,((ai<0||ai>=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+ai])).Center();am=ak[0];an=ak[1];ao=(ap=d[0].Objects,((aj<0||aj>=ap.$length)?($throwRuntimeError("index out of range"),undefined):ap.$array[ap.$offset+aj])).Center();aq=ao[0];ar=ao[1];return new B.Vector([am,an]).Sub(new AC([g[0]])).Magnitude()=ak.$length)?($throwRuntimeError("index out of range"),undefined):ak.$array[ak.$offset+ai])).X,f[0]))+((al=f[0]/2,(al===al&&al!==1/0&&al!==-1/0)?al>>0:$throwRuntimeError("integer divide by zero")))>>0)),((($imul((am=d[0].Cells,((ai<0||ai>=am.$length)?($throwRuntimeError("index out of range"),undefined):am.$array[am.$offset+ai])).Y,e[0]))+((an=e[0]/2,(an===an&&an!==1/0&&an!==-1/0)?an>>0:$throwRuntimeError("integer divide by zero")))>>0))]).Sub(new AC([g[0]])).Magnitude()=ao.$length)?($throwRuntimeError("index out of range"),undefined):ao.$array[ao.$offset+aj])).X,f[0]))+((ap=f[0]/2,(ap===ap&&ap!==1/0&&ap!==-1/0)?ap>>0:$throwRuntimeError("integer divide by zero")))>>0)),((($imul((aq=d[0].Cells,((aj<0||aj>=aq.$length)?($throwRuntimeError("index out of range"),undefined):aq.$array[aq.$offset+aj])).Y,e[0]))+((ar=e[0]/2,(ar===ar&&ar!==1/0&&ar!==-1/0)?ar>>0:$throwRuntimeError("integer divide by zero")))>>0))]).Sub(new AC([g[0]])).Magnitude();};})(d,e,f,g));$s=2;case 2:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$s=-1;return d[0];}return;}var $f={$blk:Q.ptr.prototype.Check,$c:true,$r,a,aa,ab,ac,ad,ae,af,ag,ah,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;};Q.prototype.Check=function(a,b,c){return this.$val.Check(a,b,c);};Q.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;};Q.prototype.Overlaps=function(a){return this.$val.Overlaps(a);};Q.ptr.prototype.AddToIgnoreList=function(a){var a,b,c;b=this;c=a;(b.ignoreList||$throwRuntimeError("assignment to entry in nil map"))[AA.keyFor(c)]={k:c,v:true};};Q.prototype.AddToIgnoreList=function(a){return this.$val.AddToIgnoreList(a);};Q.ptr.prototype.RemoveFromIgnoreList=function(a){var a,b;b=this;delete b.ignoreList[AA.keyFor(a)];};Q.prototype.RemoveFromIgnoreList=function(a){return this.$val.RemoveFromIgnoreList(a);};T=function(){return new S.ptr(AA.nil,0,0,new AB([]),X.nil);};$pkg.NewCollision=T;S.ptr.prototype.HasTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===b.checkingObject){d++;continue;}if(e.HasTags(a)){return true;}d++;}return false;};S.prototype.HasTags=function(a){return this.$val.HasTags(a);};S.ptr.prototype.ObjectsByTags=function(a){var a,b,c,d,e,f;b=this;c=new AB([]);d=b.Objects;e=0;while(true){if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);if(f===b.checkingObject){e++;continue;}if(f.HasTags(a)){c=$append(c,f);}e++;}return c;};S.prototype.ObjectsByTags=function(a){return this.$val.ObjectsByTags(a);};S.ptr.prototype.ContactWithObject=function(a){var a,b,c;b=this;c=new B.Vector([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;};S.prototype.ContactWithObject=function(a){return this.$val.ContactWithObject(a);};S.ptr.prototype.ContactWithCell=function(a){var a,b,c,d,e;b=this;c=new B.Vector([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;};S.prototype.ContactWithCell=function(a){return this.$val.ContactWithCell(a);};S.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,u;c=this;d=c.checkingObject.Space;f=(e=c.Cells,(0>=e.$length?($throwRuntimeError("index out of range"),undefined):e.$array[e.$offset+0]));g=d.SpaceToWorld(f.X,f.Y);h=g[0];i=g[1];j=(d.CellWidth)/2;k=(d.CellHeight)/2;h=h+(j);i=i+(k);l=c.checkingObject.Center();m=l[0];n=l[1];o=m-h;p=n-i;q=d.Cell(f.X-1>>0,f.Y);r=d.Cell(f.X+1>>0,f.Y);s=d.Cell(f.X,f.Y-1>>0);t=d.Cell(f.X,f.Y+1>>0);u=new B.Vector([0,0]);if(!((c.dy===0))){if(o>0&&(r===W.nil||!r.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h+j-c.checkingObject.X);}else if(o<0&&(q===W.nil||!q.ContainsTags(b))){(0>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+0]=h-j-(c.checkingObject.X+c.checkingObject.W));}else{return B.Vector.nil;}}if(!((c.dx===0))){if(p>0&&(t===W.nil||!t.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i+k-c.checkingObject.Y);}else if(p<0&&(s===W.nil||!s.ContainsTags(b))){(1>=u.$length?($throwRuntimeError("index out of range"),undefined):u.$array[u.$offset+1]=i-k-(c.checkingObject.Y+c.checkingObject.H));}else{return B.Vector.nil;}}return u;};S.prototype.SlideAgainstCell=function(a,b){return this.$val.SlideAgainstCell(a,b);};V=function(a,b){var a,b;return new U.ptr(a,b,new AB([]));};U.ptr.prototype.register=function(a){var a,b;b=this;if(!b.Contains(a)){b.Objects=$append(b.Objects,a);}};U.prototype.register=function(a){return this.$val.register(a);};U.ptr.prototype.unregister=function(a){var a,b,c,d,e,f,g,h,i;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(f===a){(i=b.Objects,((e<0||e>=i.$length)?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+e]=(g=b.Objects,h=b.Objects.$length-1>>0,((h<0||h>=g.$length)?($throwRuntimeError("index out of range"),undefined):g.$array[g.$offset+h]))));b.Objects=$subslice(b.Objects,0,(b.Objects.$length-1>>0));break;}d++;}};U.prototype.unregister=function(a){return this.$val.unregister(a);};U.ptr.prototype.Contains=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e===a){return true;}d++;}return false;};U.prototype.Contains=function(a){return this.$val.Contains(a);};U.ptr.prototype.ContainsTags=function(a){var a,b,c,d,e;b=this;c=b.Objects;d=0;while(true){if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);if(e.HasTags(a)){return true;}d++;}return false;};U.prototype.ContainsTags=function(a){return this.$val.ContainsTags(a);};U.ptr.prototype.Occupied=function(){var a;a=this;return a.Objects.$length>0;};U.prototype.Occupied=function(){return this.$val.Occupied();};Z.methods=[{prop:"Add",name:"Add",pkg:"",typ:$funcType([AB],[],true)},{prop:"Remove",name:"Remove",pkg:"",typ:$funcType([AB],[],true)},{prop:"Objects",name:"Objects",pkg:"",typ:$funcType([],[AB],false)},{prop:"Resize",name:"Resize",pkg:"",typ:$funcType([$Int,$Int],[],false)},{prop:"Cell",name:"Cell",pkg:"",typ:$funcType([$Int,$Int],[W],false)},{prop:"CheckCells",name:"CheckCells",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int,AJ],[AA],true)},{prop:"UnregisterAllObjects",name:"UnregisterAllObjects",pkg:"",typ:$funcType([],[],false)},{prop:"WorldToSpace",name:"WorldToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int],false)},{prop:"SpaceToWorld",name:"SpaceToWorld",pkg:"",typ:$funcType([$Int,$Int],[$Float64,$Float64],false)},{prop:"Height",name:"Height",pkg:"",typ:$funcType([],[$Int],false)},{prop:"Width",name:"Width",pkg:"",typ:$funcType([],[$Int],false)},{prop:"CellsInLine",name:"CellsInLine",pkg:"",typ:$funcType([$Int,$Int,$Int,$Int],[X],false)}];AE.methods=[{prop:"Project",name:"Project",pkg:"",typ:$funcType([B.Vector],[B.Vector],false)},{prop:"Normal",name:"Normal",pkg:"",typ:$funcType([],[B.Vector],false)},{prop:"Vector",name:"Vector",pkg:"",typ:$funcType([],[B.Vector],false)},{prop:"IntersectionPointsLine",name:"IntersectionPointsLine",pkg:"",typ:$funcType([AE],[B.Vector],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AG],[AC],false)}];AH.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[F],false)},{prop:"AddPointsVec",name:"AddPointsVec",pkg:"",typ:$funcType([AC],[],true)},{prop:"AddPoints",name:"AddPoints",pkg:"",typ:$funcType([AD],[],true)},{prop:"Lines",name:"Lines",pkg:"",typ:$funcType([],[AF],false)},{prop:"Transformed",name:"Transformed",pkg:"",typ:$funcType([],[AC],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B.Vector,B.Vector],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([B.Vector],[],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([B.Vector],[],false)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[B.Vector],false)},{prop:"Project",name:"Project",pkg:"",typ:$funcType([B.Vector],[P],false)},{prop:"SATAxes",name:"SATAxes",pkg:"",typ:$funcType([],[AC],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([B.Vector],[$Bool],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,F],[AI],false)},{prop:"calculateMTV",name:"calculateMTV",pkg:"github.com/solarlune/resolv",typ:$funcType([AI,F],[B.Vector],false)},{prop:"ContainedBy",name:"ContainedBy",pkg:"",typ:$funcType([F],[$Bool],false)},{prop:"FlipH",name:"FlipH",pkg:"",typ:$funcType([],[],false)},{prop:"FlipV",name:"FlipV",pkg:"",typ:$funcType([],[],false)},{prop:"ReverseVertexOrder",name:"ReverseVertexOrder",pkg:"",typ:$funcType([],[],false)}];AI.methods=[{prop:"LeftmostPoint",name:"LeftmostPoint",pkg:"",typ:$funcType([],[B.Vector],false)},{prop:"RightmostPoint",name:"RightmostPoint",pkg:"",typ:$funcType([],[B.Vector],false)},{prop:"TopmostPoint",name:"TopmostPoint",pkg:"",typ:$funcType([],[B.Vector],false)},{prop:"BottommostPoint",name:"BottommostPoint",pkg:"",typ:$funcType([],[B.Vector],false)}];AG.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[F],false)},{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B.Vector,B.Vector],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,F],[AI],false)},{prop:"Move",name:"Move",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"MoveVec",name:"MoveVec",pkg:"",typ:$funcType([B.Vector],[],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"SetPositionVec",name:"SetPositionVec",pkg:"",typ:$funcType([B.Vector],[],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"PointInside",name:"PointInside",pkg:"",typ:$funcType([B.Vector],[$Bool],false)},{prop:"IntersectionPointsCircle",name:"IntersectionPointsCircle",pkg:"",typ:$funcType([AG],[AC],false)}];P.methods=[{prop:"Overlapping",name:"Overlapping",pkg:"",typ:$funcType([P],[$Bool],false)},{prop:"Overlap",name:"Overlap",pkg:"",typ:$funcType([P],[$Float64],false)},{prop:"IsInside",name:"IsInside",pkg:"",typ:$funcType([P],[$Bool],false)}];AA.methods=[{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[AA],false)},{prop:"Update",name:"Update",pkg:"",typ:$funcType([],[],false)},{prop:"AddTags",name:"AddTags",pkg:"",typ:$funcType([AJ],[],true)},{prop:"RemoveTags",name:"RemoveTags",pkg:"",typ:$funcType([AJ],[],true)},{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AJ],[$Bool],true)},{prop:"Tags",name:"Tags",pkg:"",typ:$funcType([],[AJ],false)},{prop:"SetShape",name:"SetShape",pkg:"",typ:$funcType([F],[],false)},{prop:"BoundsToSpace",name:"BoundsToSpace",pkg:"",typ:$funcType([$Float64,$Float64],[$Int,$Int,$Int,$Int],false)},{prop:"SharesCells",name:"SharesCells",pkg:"",typ:$funcType([AA],[$Bool],false)},{prop:"SharesCellsTags",name:"SharesCellsTags",pkg:"",typ:$funcType([AJ],[$Bool],true)},{prop:"Center",name:"Center",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetCenter",name:"SetCenter",pkg:"",typ:$funcType([$Float64,$Float64],[],false)},{prop:"CellPosition",name:"CellPosition",pkg:"",typ:$funcType([],[$Int,$Int],false)},{prop:"SetRight",name:"SetRight",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"SetBottom",name:"SetBottom",pkg:"",typ:$funcType([$Float64],[],false)},{prop:"Bottom",name:"Bottom",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"Right",name:"Right",pkg:"",typ:$funcType([],[$Float64],false)},{prop:"SetBounds",name:"SetBounds",pkg:"",typ:$funcType([B.Vector,B.Vector],[],false)},{prop:"Check",name:"Check",pkg:"",typ:$funcType([$Float64,$Float64,AJ],[AK],true)},{prop:"Overlaps",name:"Overlaps",pkg:"",typ:$funcType([AA],[$Bool],false)},{prop:"AddToIgnoreList",name:"AddToIgnoreList",pkg:"",typ:$funcType([AA],[],false)},{prop:"RemoveFromIgnoreList",name:"RemoveFromIgnoreList",pkg:"",typ:$funcType([AA],[],false)}];AK.methods=[{prop:"HasTags",name:"HasTags",pkg:"",typ:$funcType([AJ],[$Bool],true)},{prop:"ObjectsByTags",name:"ObjectsByTags",pkg:"",typ:$funcType([AJ],[AB],true)},{prop:"ContactWithObject",name:"ContactWithObject",pkg:"",typ:$funcType([AA],[B.Vector],false)},{prop:"ContactWithCell",name:"ContactWithCell",pkg:"",typ:$funcType([W],[B.Vector],false)},{prop:"SlideAgainstCell",name:"SlideAgainstCell",pkg:"",typ:$funcType([W,AJ],[B.Vector],true)}];W.methods=[{prop:"register",name:"register",pkg:"github.com/solarlune/resolv",typ:$funcType([AA],[],false)},{prop:"unregister",name:"unregister",pkg:"github.com/solarlune/resolv",typ:$funcType([AA],[],false)},{prop:"Contains",name:"Contains",pkg:"",typ:$funcType([AA],[$Bool],false)},{prop:"ContainsTags",name:"ContainsTags",pkg:"",typ:$funcType([AJ],[$Bool],true)},{prop:"Occupied",name:"Occupied",pkg:"",typ:$funcType([],[$Bool],false)}];D.init("",[{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:Y,tag:""},{prop:"CellWidth",name:"CellWidth",embedded:false,exported:true,typ:$Int,tag:""},{prop:"CellHeight",name:"CellHeight",embedded:false,exported:true,typ:$Int,tag:""}]);F.init([{prop:"Bounds",name:"Bounds",pkg:"",typ:$funcType([],[B.Vector,B.Vector],false)},{prop:"Clone",name:"Clone",pkg:"",typ:$funcType([],[F],false)},{prop:"Intersection",name:"Intersection",pkg:"",typ:$funcType([$Float64,$Float64,F],[AI],false)},{prop:"Position",name:"Position",pkg:"",typ:$funcType([],[$Float64,$Float64],false)},{prop:"SetPosition",name:"SetPosition",pkg:"",typ:$funcType([$Float64,$Float64],[],false)}]);G.init("",[{prop:"Start",name:"Start",embedded:false,exported:true,typ:B.Vector,tag:""},{prop:"End",name:"End",embedded:false,exported:true,typ:B.Vector,tag:""}]);I.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AC,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Closed",name:"Closed",embedded:false,exported:true,typ:$Bool,tag:""}]);K.init("",[{prop:"Points",name:"Points",embedded:false,exported:true,typ:AC,tag:""},{prop:"MTV",name:"MTV",embedded:false,exported:true,typ:B.Vector,tag:""},{prop:"Center",name:"Center",embedded:false,exported:true,typ:B.Vector,tag:""}]);N.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Radius",name:"Radius",embedded:false,exported:true,typ:$Float64,tag:""}]);P.init("",[{prop:"Min",name:"Min",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Max",name:"Max",embedded:false,exported:true,typ:$Float64,tag:""}]);Q.init("github.com/solarlune/resolv",[{prop:"Shape",name:"Shape",embedded:false,exported:true,typ:F,tag:""},{prop:"Space",name:"Space",embedded:false,exported:true,typ:Z,tag:""},{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"W",name:"W",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"H",name:"H",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"TouchingCells",name:"TouchingCells",embedded:false,exported:true,typ:X,tag:""},{prop:"Data",name:"Data",embedded:false,exported:true,typ:$emptyInterface,tag:""},{prop:"ignoreList",name:"ignoreList",embedded:false,exported:false,typ:AL,tag:""},{prop:"tags",name:"tags",embedded:false,exported:false,typ:AJ,tag:""}]);S.init("github.com/solarlune/resolv",[{prop:"checkingObject",name:"checkingObject",embedded:false,exported:false,typ:AA,tag:""},{prop:"dx",name:"dx",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"dy",name:"dy",embedded:false,exported:false,typ:$Float64,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AB,tag:""},{prop:"Cells",name:"Cells",embedded:false,exported:true,typ:X,tag:""}]);U.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Int,tag:""},{prop:"Objects",name:"Objects",embedded:false,exported:true,typ:AB,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=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;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}}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,G,I,J,K,L,O,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,AX,AY,N,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD;A=$packages["github.com/kvartborg/vector"];B=$packages["github.com/solarlune/resolv"];C=$packages["math"];D=$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_;});E=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=AU.nil;this.Points=AV.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});F=$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_,Hp_,MaxHp_,CharacterState_,InAir_,Name_,DisplayName_,Avatar_){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.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;this.Name="";this.DisplayName="";this.Avatar="";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.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;this.Name=Name_;this.DisplayName=DisplayName_;this.Avatar=Avatar_;});G=$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_;});I=$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=AW.nil;this.ConfirmedList=new $Uint64(0,0);return;}this.InputFrameId=InputFrameId_;this.InputList=InputList_;this.ConfirmedList=ConfirmedList_;});J=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=AX.nil;return;}this.Boundary=Boundary_;});K=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BattleLocalId_,StartupFrames_,ActiveFrames_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,Moveforward_,HitboxOffset_,HitboxSize_,OriginatedRenderFrameId_,HitStunFrames_,BlockStunFrames_,Pushback_,ReleaseTriggerType_,Damage_,OffenderJoinIndex_,OffenderPlayerId_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.StartupFrames=0;this.ActiveFrames=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.Moveforward=AU.nil;this.HitboxOffset=0;this.HitboxSize=AU.nil;this.OriginatedRenderFrameId=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.Pushback=0;this.ReleaseTriggerType=0;this.Damage=0;this.OffenderJoinIndex=0;this.OffenderPlayerId=0;return;}this.BattleLocalId=BattleLocalId_;this.StartupFrames=StartupFrames_;this.ActiveFrames=ActiveFrames_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.Moveforward=Moveforward_;this.HitboxOffset=HitboxOffset_;this.HitboxSize=HitboxSize_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.Pushback=Pushback_;this.ReleaseTriggerType=ReleaseTriggerType_;this.Damage=Damage_;this.OffenderJoinIndex=OffenderJoinIndex_;this.OffenderPlayerId=OffenderPlayerId_;});L=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,BackendUnconfirmedMask_,ShouldForceResync_,Players_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=AN.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=AS.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;this.Players=false;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;this.Players=Players_;});O=$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=A.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});AE=$sliceType($Int32);AF=$sliceType(AE);AG=$ptrType(O);AH=$sliceType(D);AI=$sliceType($String);AJ=$ptrType(B.Collision);AK=$ptrType(J);AL=$ptrType(B.ConvexPolygon);AM=$ptrType(F);AN=$sliceType(AM);AO=$sliceType(AH);AP=$ptrType(I);AQ=$ptrType(B.Object);AR=$ptrType(K);AS=$sliceType(AR);AT=$sliceType($Float64);AU=$ptrType(D);AV=$sliceType(AU);AW=$sliceType($Uint64);AX=$ptrType(E);AY=$mapType($Int32,AM);N=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 G.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);};$pkg.DecodeInput=N;P=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 O.ptr(0,0,0,true,true,new A.Vector([0,0]));i=Q(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,AG.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,AG.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:P,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};$pkg.CalcPushbacks=P;Q=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;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(AG.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(R(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(R(a,b,u.Unit(),c)){return false;}t++;}}return true;};R=function(a,b,c,d){var a,aa,ab,ac,ad,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=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};S=function(a,b,c){var a,b,c,d,e;d=((C.Round(a*c)>>0));e=((C.Round(b*c)>>0));return[d,e];};$pkg.WorldToVirtualGridPos=S;T=function(a,b,c){var a,b,c,d,e;d=(a)*c;e=(b)*c;return[d,e];};$pkg.VirtualGridToWorldPos=T;U=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=U;V=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=V;W=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=V(a,b,c,d,e,f,g,h,i,j);m=l[0];n=l[1];return S(m,n,k);};$pkg.PolygonColliderBLToVirtualGridPos=W;X=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=T(a,b,k);m=l[0];n=l[1];return U(m,n,c,d,e,f,g,h,i,j);};$pkg.VirtualGridToPolygonColliderBLPos=X;Y=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,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=$makeSlice(AH,0,10);f=a.Check(0,0,new AI([]));$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;if(AJ.nil===g){$s=-1;return e;}h=g.Objects;i=0;case 2:if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);k=j.Data;if($assertType(k,AK,true)[1]){$s=4;continue;}$s=5;continue;case 4:l=$assertType(j.Shape,AL);n=P(0,0,b,l);$s=7;case 7:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}m=n;o=m[0];p=m[1];q=m[2];r=m[3];if(!o){i++;$s=2;continue;}s=(r.Overlap-c)*r.OverlapX;t=(r.Overlap-c)*r.OverlapY;p=s;q=t;e=$append(e,new D.ptr(r.OverlapX,r.OverlapY));d.X=d.X+(p);d.Y=d.Y+(q);$s=6;continue;case 5:case 6:i++;$s=2;continue;case 3:$s=-1;return e;}return;}var $f={$blk:Y,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s};return $f;};$pkg.CalcHardPushbacksNorms=Y;Z=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{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,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,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=c.PlayersArr.$length;r=$makeSlice(AN,q);s=c.PlayersArr;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]=new F.ptr(v.Id,v.VirtualGridX,v.VirtualGridY,v.DirX,v.DirY,v.VelX,v.VelY,v.Speed,v.BattleState,v.JoinIndex,0,v.Removed,v.Score,0,v.FramesToRecover-1>>0,v.Hp,v.MaxHp,v.CharacterState,true,"","",""));if(((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover<0){((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover=0;}t++;}w=$makeSlice(AH,q);x=$makeSlice(AO,q);if(!(AP.nil===a)){y=a.InputList;z=c.PlayersArr;aa=0;while(true){if(!(aa=z.$length)?($throwRuntimeError("index out of range"),undefined):z.$array[z.$offset+aa]);ad=ac.JoinIndex;ae=((ab<0||ab>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ab]);if(0>0,((af<0||af>=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+af])));ah=0;if(!(AP.nil===b)){ak=N((ai=b.InputList,aj=ad-1>>0,((aj<0||aj>=ai.$length)?($throwRuntimeError("index out of range"),undefined):ai.$array[ai.$offset+aj])));ah=ak.BtnBLevel;}if(ag.BtnBLevel>ah){al=false;if((4===ae.CharacterState)||(5===ae.CharacterState)||(6===ae.CharacterState)){al=true;}am=false;if((0===ae.CharacterState)||(1===ae.CharacterState)||(4===ae.CharacterState)){am=true;}if(!al&&am){ae.VelY=h;}}if(!((0===ag.Dx))||!((0===ag.Dy))){ae.DirX=ag.Dx;ae.DirY=ag.Dy;ae.VelX=$imul(ag.Dx,ac.Speed);ae.CharacterState=1;}else{ae.CharacterState=0;ae.VelX=0;}aa++;}}an=c.PlayersArr;ao=0;case 1:if(!(ao=an.$length)?($throwRuntimeError("index out of range"),undefined):an.$array[an.$offset+ao]);ar=aq.JoinIndex;as=0;at=0;(au=ar-1>>0,((au<0||au>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+au])).X=as;(av=ar-1>>0,((av<0||av>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+av])).Y=at;aw=131072+ar>>0;ay=(ax=e[$Int32.keyFor(aw)],ax!==undefined?ax.v:AQ.nil);az=((ap<0||ap>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+ap]);ba=aq.VirtualGridX+aq.VelX>>0;bb=aq.VirtualGridY+aq.VelY>>0;bc=ba;bd=bb;if(az.VelY===h){bd=bd+(az.VelY)>>0;}be=X(bc,bd,ay.W*0.5,ay.H*0.5,0,0,0,0,k,l,p);ay.X=be[0];ay.Y=be[1];$r=ay.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(aq.InAir){az.VelX=az.VelX+(f)>>0;az.VelY=az.VelY+(g)>>0;}ao++;$s=1;continue;case 2:bf=c.PlayersArr;bg=0;case 4:if(!(bg=bf.$length)?($throwRuntimeError("index out of range"),undefined):bf.$array[bf.$offset+bg]);bj=bi.JoinIndex;bk=131072+bj>>0;bm=(bl=e[$Int32.keyFor(bk)],bl!==undefined?bl.v:AQ.nil);bn=$assertType(bm.Shape,AL);bp=Y(bm,bn,m,(bo=bj-1>>0,((bo<0||bo>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+bo])));$s=6;case 6:if($c){$c=false;bp=bp.$blk();}if(bp&&bp.$blk!==undefined){break s;}(bq=bj-1>>0,((bq<0||bq>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+bq]=bp));br=((bh<0||bh>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+bh]);bs=false;bt=bm.Check(0,0,new AI([]));$s=7;case 7:if($c){$c=false;bt=bt.$blk();}if(bt&&bt.$blk!==undefined){break s;}bu=bt;if(!(AJ.nil===bu)){$s=8;continue;}$s=9;continue;case 8:bv=bu.Objects;bw=0;case 10:if(!(bw=bv.$length)?($throwRuntimeError("index out of range"),undefined):bv.$array[bv.$offset+bw]);by=false;bz=false;ca=false;cb=by;cc=bz;cd=ca;ce=bx.Data;if($assertType(ce,AK,true)[1]){cb=true;}else if($assertType(ce,AM,true)[1]){cc=true;}else if($assertType(ce,AR,true)[1]){cd=true;}if(cd){bw++;$s=10;continue;}cf=$assertType(bx.Shape,AL);ch=P(0,0,bn,cf);$s=12;case 12:if($c){$c=false;ch=ch.$blk();}if(ch&&ch.$blk!==undefined){break s;}cg=ch;ci=cg[0];cj=cg[1];ck=cg[2];cl=cg[3];if(!ci){bw++;$s=10;continue;}cm=cl.OverlapX*0+cl.OverlapY*-1;cn=n>0,((ct<0||ct>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+ct]));cu=0;while(true){if(!(cu=cs.$length)?($throwRuntimeError("index out of range"),undefined):cs.$array[cs.$offset+cu]),D);cw=cj*cv.X+ck*cv.Y;if(cb||(cc&&0>cw)){cj=cj-(cw*cv.X);ck=ck-(cw*cv.Y);}cu++;}cx=bj-1>>0;((cx<0||cx>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cx]).X=((cx<0||cx>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cx]).X+(cj);cy=bj-1>>0;((cy<0||cy>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cy]).Y=((cy<0||cy>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cy]).Y+(ck);if(bi.InAir&&cn){bs=true;}bw++;$s=10;continue;case 11:case 9:if(bs){br.VelX=0;br.VelY=0;br.CharacterState=0;br.FramesToRecover=0;}if(bi.InAir){cz=br.CharacterState;da=cz;if((da===(0))||(da===(1))){br.CharacterState=4;}else if(da===(2)){br.CharacterState=5;}else if(da===(3)){br.CharacterState=6;}}bg++;$s=4;continue;case 5:db=c.PlayersArr;dc=0;while(true){if(!(dc=db.$length)?($throwRuntimeError("index out of range"),undefined):db.$array[db.$offset+dc]);df=de.JoinIndex;dg=131072+df>>0;di=(dh=e[$Int32.keyFor(dg)],dh!==undefined?dh.v:AQ.nil);dj=((dd<0||dd>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+dd]);dk=W(di.X-(dl=df-1>>0,((dl<0||dl>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dl])).X,di.Y-(dm=df-1>>0,((dm<0||dm>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dm])).Y,di.W*0.5,di.H*0.5,0,0,0,0,k,l,o);dj.VirtualGridX=dk[0];dj.VirtualGridY=dk[1];dc++;}$s=-1;return new L.ptr(c.Id+1>>0,r,new $Int64(0,0),AS.nil,new $Uint64(0,0),false,false);}return;}var $f={$blk:Z,$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,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;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=Z;AA=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=U(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=AB(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:AA,$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=AA;AB=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.NewObject(a,b,c,d,new AI([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:AB,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AC=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=AD(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(AT.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(C.Abs(s.X-o.X)>i){i=C.Abs(s.X-o.X);}if(C.Abs(s.Y-o.Y)>j){j=C.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 AT([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new AI([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:AC,$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=AC;AD=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new D.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 D.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=AD;D.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);E.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:AU,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:AV,tag:""}]);F.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:$Float64,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:"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:"Name",name:"Name",embedded:false,exported:true,typ:$String,tag:""},{prop:"DisplayName",name:"DisplayName",embedded:false,exported:true,typ:$String,tag:""},{prop:"Avatar",name:"Avatar",embedded:false,exported:true,typ:$String,tag:""}]);G.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:""}]);I.init("",[{prop:"InputFrameId",name:"InputFrameId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"InputList",name:"InputList",embedded:false,exported:true,typ:AW,tag:""},{prop:"ConfirmedList",name:"ConfirmedList",embedded:false,exported:true,typ:$Uint64,tag:""}]);J.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:AX,tag:""}]);K.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",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:"Moveforward",name:"Moveforward",embedded:false,exported:true,typ:AU,tag:""},{prop:"HitboxOffset",name:"HitboxOffset",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSize",name:"HitboxSize",embedded:false,exported:true,typ:AU,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",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:"Pushback",name:"Pushback",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderPlayerId",name:"OffenderPlayerId",embedded:false,exported:true,typ:$Int32,tag:""}]);L.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:AN,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:AS,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Players",name:"Players",embedded:false,exported:true,typ:AY,tag:""}]);O.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:A.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;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new AF([new AE([0,0]),new AE([0,2]),new AE([0,-2]),new AE([2,0]),new AE([-2,0]),new AE([1,1]),new AE([-1,-1]),new AE([1,-1]),new AE([-1,1])]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); -$packages["jsexport"]=(function(){var $pkg={},$init,A,B,C,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,D,E,F,G,H,I,J,K,L,M,N,O,P,Q;A=$packages["github.com/gopherjs/gopherjs/js"];B=$packages["github.com/solarlune/resolv"];C=$packages["jsexport/battle"];R=$ptrType(C.Vec2D);S=$sliceType(R);T=$ptrType(C.Polygon2D);U=$ptrType(C.PlayerDownsync);V=$sliceType(U);W=$ptrType(C.MeleeBullet);X=$sliceType(W);Y=$sliceType($Uint64);Z=$ptrType(A.Object);AA=$sliceType(Z);AB=$sliceType($String);AC=$funcType([$Float64,$Float64],[Z],false);AD=$funcType([R,S],[Z],false);AE=$funcType([T],[Z],false);AF=$funcType([$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Bool,$Float64],[Z],false);AG=$funcType([$Int32,V,X],[Z],false);AH=$funcType([$Int,$Int,$Int,$Int],[Z],false);AI=$funcType([$Int32,Y,$Uint64],[Z],false);AJ=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$emptyInterface,$String],[Z],false);AK=$funcType([T,$Float64,$Float64,$emptyInterface,$String],[Z],false);AL=$ptrType(C.RoomDownsyncFrame);AM=$funcType([AL],[AA],false);AN=$ptrType(B.Space);AO=$funcType([AN],[AA],false);AP=$ptrType(C.InputFrameDownsync);AQ=$ptrType(B.Object);AR=$mapType($Int32,AQ);AS=$funcType([AP,AP,AL,AN,AR,$Int32,$Int32,$Int32,$Int32,$Int32,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[Z],false);AT=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[$Float64,$Float64],false);AU=$funcType([AQ,$Float64,$Float64],[Z],false);AV=$mapType($String,$emptyInterface);D=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(B.NewSpace(a,b,c,d));};$pkg.NewCollisionSpaceJs=D;E=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new C.Vec2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:E,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewVec2DJs=E;F=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new C.Polygon2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:F,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewPolygon2DJs=F;G=function(a){var a;return A.MakeWrapper(new C.Barrier.ptr(a));};$pkg.NewBarrierJs=G;H=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;return A.MakeWrapper(new C.PlayerDownsync.ptr(a,b,c,d,e,f,g,h,i,k,o,false,0,0,0,l,m,j,n,"","",""));};$pkg.NewPlayerDownsyncJs=H;I=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=A.MakeFullWrapper(new C.RoomDownsyncFrame.ptr(a,b,new $Int64(0,0),c,new $Uint64(0,0),false,false));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;$s=2;case 2:return e;}return;}var $f={$blk:I,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewRoomDownsyncFrameJs=I;J=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=A.MakeFullWrapper(new C.InputFrameDownsync.ptr(a,b,c));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;$s=2;case 2:return e;}return;}var $f={$blk:J,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewInputFrameDownsyncJs=J;K=function(a){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=a.Objects();c=$makeSlice(AA,0,b.$length);d=b;e=0;case 1:if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);g=A.MakeFullWrapper(f);$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}c=$append(c,g);e++;$s=1;continue;case 2:$s=-1;return c;}return;}var $f={$blk:K,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.GetCollisionSpaceObjsJs=K;L=function(a){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=$makeSlice(AA,0,a.PlayersArr.$length);c=a.PlayersArr;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=A.MakeFullWrapper(e);$s=3;case 3:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}b=$append(b,f);d++;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:L,$c:true,$r,a,b,c,d,e,f,$s};return $f;};$pkg.GetPlayersArrJs=L;M=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,$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=C.GenerateRectCollider(a,b,c,d,e,f,g,h,i,j,k,l);$s=1;case 1:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}n=A.MakeFullWrapper(m);$s=2;case 2:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=3;case 3:return o;}return;}var $f={$blk:M,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s};return $f;};$pkg.GenerateRectColliderJs=M;N=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=C.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.MakeFullWrapper(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:N,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=N;O=function(a,b,c){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=a.Check(b,c,new AB([]));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=A.MakeFullWrapper(d);$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;$s=3;case 3:return f;}return;}var $f={$blk:O,$c:true,$r,a,b,c,d,e,f,$s};return $f;};$pkg.CheckCollisionJs=O;P=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=C.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=A.MakeFullWrapper(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=3;case 3:return s;}return;}var $f={$blk:P,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=P;Q=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new AC(E)},{k:"NewPolygon2DJs",v:new AD(F)},{k:"NewBarrierJs",v:new AE(G)},{k:"NewPlayerDownsyncJs",v:new AF(H)},{k:"NewRoomDownsyncFrameJs",v:new AG(I)},{k:"NewCollisionSpaceJs",v:new AH(D)},{k:"NewInputFrameDownsyncJs",v:new AI(J)},{k:"GenerateRectColliderJs",v:new AJ(M)},{k:"GenerateConvexPolygonColliderJs",v:new AK(N)},{k:"GetPlayersArrJs",v:new AM(L)},{k:"GetCollisionSpaceObjsJs",v:new AO(K)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new AS(P)},{k:"WorldToPolygonColliderBLPos",v:new AT(C.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new AT(C.PolygonColliderBLToWorldPos)},{k:"CheckCollisionJs",v:new AU(O)}]),AV);};$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){Q();$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,G,I,J,K,N,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,AT,AU,AV,AW,M,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC;A=$packages["github.com/kvartborg/vector"];B=$packages["github.com/solarlune/resolv"];C=$packages["math"];D=$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_;});E=$pkg.Polygon2D=$newType(0,$kindStruct,"battle.Polygon2D",true,"jsexport/battle",true,function(Anchor_,Points_){this.$val=this;if(arguments.length===0){this.Anchor=AT.nil;this.Points=AU.nil;return;}this.Anchor=Anchor_;this.Points=Points_;});F=$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_,Hp_,MaxHp_,CharacterState_,InAir_,Name_,DisplayName_,Avatar_){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.Hp=0;this.MaxHp=0;this.CharacterState=0;this.InAir=false;this.Name="";this.DisplayName="";this.Avatar="";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.Hp=Hp_;this.MaxHp=MaxHp_;this.CharacterState=CharacterState_;this.InAir=InAir_;this.Name=Name_;this.DisplayName=DisplayName_;this.Avatar=Avatar_;});G=$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_;});I=$pkg.Barrier=$newType(0,$kindStruct,"battle.Barrier",true,"jsexport/battle",true,function(Boundary_){this.$val=this;if(arguments.length===0){this.Boundary=AV.nil;return;}this.Boundary=Boundary_;});J=$pkg.MeleeBullet=$newType(0,$kindStruct,"battle.MeleeBullet",true,"jsexport/battle",true,function(BattleLocalId_,StartupFrames_,ActiveFrames_,RecoveryFrames_,RecoveryFramesOnBlock_,RecoveryFramesOnHit_,Moveforward_,HitboxOffset_,HitboxSize_,OriginatedRenderFrameId_,HitStunFrames_,BlockStunFrames_,Pushback_,ReleaseTriggerType_,Damage_,OffenderJoinIndex_,OffenderPlayerId_){this.$val=this;if(arguments.length===0){this.BattleLocalId=0;this.StartupFrames=0;this.ActiveFrames=0;this.RecoveryFrames=0;this.RecoveryFramesOnBlock=0;this.RecoveryFramesOnHit=0;this.Moveforward=AT.nil;this.HitboxOffset=0;this.HitboxSize=AT.nil;this.OriginatedRenderFrameId=0;this.HitStunFrames=0;this.BlockStunFrames=0;this.Pushback=0;this.ReleaseTriggerType=0;this.Damage=0;this.OffenderJoinIndex=0;this.OffenderPlayerId=0;return;}this.BattleLocalId=BattleLocalId_;this.StartupFrames=StartupFrames_;this.ActiveFrames=ActiveFrames_;this.RecoveryFrames=RecoveryFrames_;this.RecoveryFramesOnBlock=RecoveryFramesOnBlock_;this.RecoveryFramesOnHit=RecoveryFramesOnHit_;this.Moveforward=Moveforward_;this.HitboxOffset=HitboxOffset_;this.HitboxSize=HitboxSize_;this.OriginatedRenderFrameId=OriginatedRenderFrameId_;this.HitStunFrames=HitStunFrames_;this.BlockStunFrames=BlockStunFrames_;this.Pushback=Pushback_;this.ReleaseTriggerType=ReleaseTriggerType_;this.Damage=Damage_;this.OffenderJoinIndex=OffenderJoinIndex_;this.OffenderPlayerId=OffenderPlayerId_;});K=$pkg.RoomDownsyncFrame=$newType(0,$kindStruct,"battle.RoomDownsyncFrame",true,"jsexport/battle",true,function(Id_,PlayersArr_,CountdownNanos_,MeleeBullets_,BackendUnconfirmedMask_,ShouldForceResync_,Players_){this.$val=this;if(arguments.length===0){this.Id=0;this.PlayersArr=AM.nil;this.CountdownNanos=new $Int64(0,0);this.MeleeBullets=AR.nil;this.BackendUnconfirmedMask=new $Uint64(0,0);this.ShouldForceResync=false;this.Players=false;return;}this.Id=Id_;this.PlayersArr=PlayersArr_;this.CountdownNanos=CountdownNanos_;this.MeleeBullets=MeleeBullets_;this.BackendUnconfirmedMask=BackendUnconfirmedMask_;this.ShouldForceResync=ShouldForceResync_;this.Players=Players_;});N=$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=A.Vector.nil;return;}this.Overlap=Overlap_;this.OverlapX=OverlapX_;this.OverlapY=OverlapY_;this.AContainedInB=AContainedInB_;this.BContainedInA=BContainedInA_;this.Axis=Axis_;});AD=$sliceType($Int32);AE=$sliceType(AD);AF=$ptrType(N);AG=$sliceType(D);AH=$sliceType($String);AI=$ptrType(B.Collision);AJ=$ptrType(I);AK=$ptrType(B.ConvexPolygon);AL=$ptrType(F);AM=$sliceType(AL);AN=$sliceType(AG);AO=$sliceType($Uint64);AP=$ptrType(B.Object);AQ=$ptrType(J);AR=$sliceType(AQ);AS=$sliceType($Float64);AT=$ptrType(D);AU=$sliceType(AT);AV=$ptrType(E);AW=$mapType($Int32,AL);M=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 G.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);};O=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 N.ptr(0,0,0,true,true,new A.Vector([0,0]));i=P(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,AF.nil];}return;}}catch(err){$err=err;$s=-1;return[false,0,0,AF.nil];}finally{$callDeferred($deferred,$err);if($curGoroutine.asleep){var $f={$blk:O,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s,$deferred};return $f;}}};$pkg.CalcPushbacks=O;P=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;d=a.Points.$length;e=b.Points.$length;f=d;g=e;if((1===f)&&(1===g)){if(!(AF.nil===c)){c.Overlap=0;}return((h=(i=a.Points,(0>=i.$length?($throwRuntimeError("index out of range"),undefined):i.$array[i.$offset+0])),(0>=h.$length?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+0]))===(j=(k=b.Points,(0>=k.$length?($throwRuntimeError("index out of range"),undefined):k.$array[k.$offset+0])),(0>=j.$length?($throwRuntimeError("index out of range"),undefined):j.$array[j.$offset+0])))&&((l=(m=a.Points,(0>=m.$length?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+0])),(1>=l.$length?($throwRuntimeError("index out of range"),undefined):l.$array[l.$offset+1]))===(n=(o=b.Points,(0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])),(1>=n.$length?($throwRuntimeError("index out of range"),undefined):n.$array[n.$offset+1])));}if(1=p.$length)?($throwRuntimeError("index out of range"),undefined):p.$array[p.$offset+q]);if(Q(a,b,r.Unit(),c)){return false;}q++;}}if(1=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);if(Q(a,b,u.Unit(),c)){return false;}t++;}}return true;};Q=function(a,b,c,d){var a,aa,ab,ac,ad,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=a.Points;n=0;while(true){if(!(n=m.$length)?($throwRuntimeError("index out of range"),undefined):m.$array[m.$offset+n]);p=((0>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+0])+a.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=o.$length?($throwRuntimeError("index out of range"),undefined):o.$array[o.$offset+1])+a.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(i>p){i=p;}if(j=q.$length)?($throwRuntimeError("index out of range"),undefined):q.$array[q.$offset+r]);t=((0>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+0])+b.X)*(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])+((1>=s.$length?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+1])+b.Y)*(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1]);if(k>t){k=t;}if(ll||jl){u=i-l;d.AContainedInB=false;}else{x=j-k;y=l-i;if(x=ab.$length?($throwRuntimeError("index out of range"),undefined):ab.$array[ab.$offset+0])))&&(0===(ac=d.Axis,(1>=ac.$length?($throwRuntimeError("index out of range"),undefined):ac.$array[ac.$offset+1]))))||z>aa){ad=1;if(u<0){ad=-1;}d.Overlap=aa;d.OverlapX=(0>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+0])*ad;d.OverlapY=(1>=c.$length?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+1])*ad;}d.Axis=c;}return false;};R=function(a,b,c){var a,b,c,d,e;d=((C.Round(a*c)>>0));e=((C.Round(b*c)>>0));return[d,e];};$pkg.WorldToVirtualGridPos=R;S=function(a,b,c){var a,b,c,d,e;d=(a)*c;e=(b)*c;return[d,e];};$pkg.VirtualGridToWorldPos=S;T=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=T;U=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=U;V=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=U(a,b,c,d,e,f,g,h,i,j);m=l[0];n=l[1];return R(m,n,k);};$pkg.PolygonColliderBLToVirtualGridPos=V;W=function(a,b,c,d,e,f,g,h,i,j,k){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;l=S(a,b,k);m=l[0];n=l[1];return T(m,n,c,d,e,f,g,h,i,j);};$pkg.VirtualGridToPolygonColliderBLPos=W;X=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,$s,$r,$c}=$restore(this,{a,b,c,d});$s=$s||0;s:while(true){switch($s){case 0:e=$makeSlice(AG,0,10);f=a.Check(0,0,new AH([]));$s=1;case 1:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}g=f;if(AI.nil===g){$s=-1;return e;}h=g.Objects;i=0;case 2:if(!(i=h.$length)?($throwRuntimeError("index out of range"),undefined):h.$array[h.$offset+i]);k=j.Data;if($assertType(k,AJ,true)[1]){$s=4;continue;}$s=5;continue;case 4:l=$assertType(j.Shape,AK);n=O(0,0,b,l);$s=7;case 7:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}m=n;o=m[0];p=m[1];q=m[2];r=m[3];if(!o){i++;$s=2;continue;}s=(r.Overlap-c)*r.OverlapX;t=(r.Overlap-c)*r.OverlapY;p=s;q=t;e=$append(e,new D.ptr(r.OverlapX,r.OverlapY));d.X=d.X+(p);d.Y=d.Y+(q);$s=6;continue;case 5:case 6:i++;$s=2;continue;case 3:$s=-1;return e;}return;}var $f={$blk:X,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,$s};return $f;};Y=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{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,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,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=c.PlayersArr.$length;r=$makeSlice(AM,q);s=c.PlayersArr;t=0;while(true){if(!(t=s.$length)?($throwRuntimeError("index out of range"),undefined):s.$array[s.$offset+t]);((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]=new F.ptr(v.Id,v.VirtualGridX,v.VirtualGridY,v.DirX,v.DirY,v.VelX,v.VelY,v.Speed,v.BattleState,v.JoinIndex,0,v.Removed,v.Score,0,v.FramesToRecover-1>>0,v.Hp,v.MaxHp,v.CharacterState,true,"","",""));if(((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover<0){((u<0||u>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+u]).FramesToRecover=0;}t++;}w=$makeSlice(AG,q);x=$makeSlice(AN,q);if(!(AO.nil===a)){y=c.PlayersArr;z=0;while(true){if(!(z=y.$length)?($throwRuntimeError("index out of range"),undefined):y.$array[y.$offset+z]);ac=ab.JoinIndex;ad=((aa<0||aa>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+aa]);if(0>0,((ae<0||ae>=a.$length)?($throwRuntimeError("index out of range"),undefined):a.$array[a.$offset+ae])));ag=0;if(!(AO.nil===b)){ai=M((ah=ac-1>>0,((ah<0||ah>=b.$length)?($throwRuntimeError("index out of range"),undefined):b.$array[b.$offset+ah])));ag=ai.BtnBLevel;}if(af.BtnBLevel>ag){aj=false;if((4===ad.CharacterState)||(5===ad.CharacterState)||(6===ad.CharacterState)){aj=true;}ak=false;if((0===ad.CharacterState)||(1===ad.CharacterState)||(4===ad.CharacterState)){ak=true;}if(!aj&&ak){ad.VelY=h;}}if(!((0===af.Dx))||!((0===af.Dy))){ad.DirX=af.Dx;ad.DirY=af.Dy;ad.VelX=$imul(af.Dx,ab.Speed);ad.CharacterState=1;}else{ad.CharacterState=0;ad.VelX=0;}z++;}}al=c.PlayersArr;am=0;case 1:if(!(am=al.$length)?($throwRuntimeError("index out of range"),undefined):al.$array[al.$offset+am]);ap=ao.JoinIndex;aq=0;ar=0;(as=ap-1>>0,((as<0||as>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+as])).X=aq;(at=ap-1>>0,((at<0||at>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+at])).Y=ar;au=131072+ap>>0;aw=(av=e[$Int32.keyFor(au)],av!==undefined?av.v:AP.nil);ax=((an<0||an>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+an]);ay=ao.VirtualGridX+ao.VelX>>0;az=ao.VirtualGridY+ao.VelY>>0;ba=ay;bb=az;if(ax.VelY===h){bb=bb+(ax.VelY)>>0;}bc=W(ba,bb,aw.W*0.5,aw.H*0.5,0,0,0,0,k,l,p);aw.X=bc[0];aw.Y=bc[1];$r=aw.Update();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}if(ao.InAir){ax.VelX=ax.VelX+(f)>>0;ax.VelY=ax.VelY+(g)>>0;}am++;$s=1;continue;case 2:bd=c.PlayersArr;be=0;case 4:if(!(be=bd.$length)?($throwRuntimeError("index out of range"),undefined):bd.$array[bd.$offset+be]);bh=bg.JoinIndex;bi=131072+bh>>0;bk=(bj=e[$Int32.keyFor(bi)],bj!==undefined?bj.v:AP.nil);bl=$assertType(bk.Shape,AK);bn=X(bk,bl,m,(bm=bh-1>>0,((bm<0||bm>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+bm])));$s=6;case 6:if($c){$c=false;bn=bn.$blk();}if(bn&&bn.$blk!==undefined){break s;}(bo=bh-1>>0,((bo<0||bo>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+bo]=bn));bp=((bf<0||bf>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+bf]);bq=false;br=bk.Check(0,0,new AH([]));$s=7;case 7:if($c){$c=false;br=br.$blk();}if(br&&br.$blk!==undefined){break s;}bs=br;if(!(AI.nil===bs)){$s=8;continue;}$s=9;continue;case 8:bt=bs.Objects;bu=0;case 10:if(!(bu=bt.$length)?($throwRuntimeError("index out of range"),undefined):bt.$array[bt.$offset+bu]);bw=false;bx=false;by=false;bz=bw;ca=bx;cb=by;cc=bv.Data;if($assertType(cc,AL,true)[1]){ca=true;}else if($assertType(cc,AQ,true)[1]){cb=true;}else{bz=true;}if(cb){bu++;$s=10;continue;}cd=$assertType(bv.Shape,AK);cf=O(0,0,bl,cd);$s=12;case 12:if($c){$c=false;cf=cf.$blk();}if(cf&&cf.$blk!==undefined){break s;}ce=cf;cg=ce[0];ch=ce[1];ci=ce[2];cj=ce[3];if(!cg){bu++;$s=10;continue;}ck=cj.OverlapX*0+cj.OverlapY*-1;cl=n>0,((cr<0||cr>=x.$length)?($throwRuntimeError("index out of range"),undefined):x.$array[x.$offset+cr]));cs=0;while(true){if(!(cs=cq.$length)?($throwRuntimeError("index out of range"),undefined):cq.$array[cq.$offset+cs]),D);cu=ch*ct.X+ci*ct.Y;if(bz||(ca&&0>cu)){ch=ch-(cu*ct.X);ci=ci-(cu*ct.Y);}cs++;}cv=bh-1>>0;((cv<0||cv>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cv]).X=((cv<0||cv>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cv]).X+(ch);cw=bh-1>>0;((cw<0||cw>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cw]).Y=((cw<0||cw>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+cw]).Y+(ci);if(bg.InAir&&cl){bq=true;}bu++;$s=10;continue;case 11:case 9:if(bq){bp.VelX=0;bp.VelY=0;bp.CharacterState=0;bp.FramesToRecover=0;}if(bg.InAir){cx=bp.CharacterState;cy=cx;if((cy===(0))||(cy===(1))){bp.CharacterState=4;}else if(cy===(2)){bp.CharacterState=5;}else if(cy===(3)){bp.CharacterState=6;}}be++;$s=4;continue;case 5:cz=c.PlayersArr;da=0;while(true){if(!(da=cz.$length)?($throwRuntimeError("index out of range"),undefined):cz.$array[cz.$offset+da]);dd=dc.JoinIndex;de=131072+dd>>0;dg=(df=e[$Int32.keyFor(de)],df!==undefined?df.v:AP.nil);dh=((db<0||db>=r.$length)?($throwRuntimeError("index out of range"),undefined):r.$array[r.$offset+db]);di=V(dg.X-(dj=dd-1>>0,((dj<0||dj>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dj])).X,dg.Y-(dk=dd-1>>0,((dk<0||dk>=w.$length)?($throwRuntimeError("index out of range"),undefined):w.$array[w.$offset+dk])).Y,dg.W*0.5,dg.H*0.5,0,0,0,0,k,l,o);dh.VirtualGridX=di[0];dh.VirtualGridY=di[1];da++;}$s=-1;return new K.ptr(c.Id+1>>0,r,new $Int64(0,0),AR.nil,new $Uint64(0,0),false,false);}return;}var $f={$blk:Y,$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,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;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame=Y;Z=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=T(a,b,c*0.5,d*0.5,e,f,g,h,i,j);n=m[0];o=m[1];p=AA(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:Z,$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=Z;AA=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.NewObject(a,b,c,d,new AH([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:AA,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};AB=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=AC(a);g=0;h=0;i=g;j=h;k=B.NewConvexPolygon(AS.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(C.Abs(s.X-o.X)>i){i=C.Abs(s.X-o.X);}if(C.Abs(s.Y-o.Y)>j){j=C.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 AS([v.X,v.Y]));t=t+(1)>>0;}w=B.NewObject(f.Anchor.X+b,f.Anchor.Y+c,i,j,new AH([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:AB,$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=AB;AC=function(a){var a,b,c,d,e,f,g,h,i,j,k;b=new D.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 D.ptr(j.X-b.X,j.Y-b.Y)));h++;}return f;};$pkg.AlignPolygon2DToBoundingBox=AC;D.init("",[{prop:"X",name:"X",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"Y",name:"Y",embedded:false,exported:true,typ:$Float64,tag:""}]);E.init("",[{prop:"Anchor",name:"Anchor",embedded:false,exported:true,typ:AT,tag:""},{prop:"Points",name:"Points",embedded:false,exported:true,typ:AU,tag:""}]);F.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:$Float64,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:"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:"Name",name:"Name",embedded:false,exported:true,typ:$String,tag:""},{prop:"DisplayName",name:"DisplayName",embedded:false,exported:true,typ:$String,tag:""},{prop:"Avatar",name:"Avatar",embedded:false,exported:true,typ:$String,tag:""}]);G.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:""}]);I.init("",[{prop:"Boundary",name:"Boundary",embedded:false,exported:true,typ:AV,tag:""}]);J.init("",[{prop:"BattleLocalId",name:"BattleLocalId",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"StartupFrames",name:"StartupFrames",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"ActiveFrames",name:"ActiveFrames",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:"Moveforward",name:"Moveforward",embedded:false,exported:true,typ:AT,tag:""},{prop:"HitboxOffset",name:"HitboxOffset",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"HitboxSize",name:"HitboxSize",embedded:false,exported:true,typ:AT,tag:""},{prop:"OriginatedRenderFrameId",name:"OriginatedRenderFrameId",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:"Pushback",name:"Pushback",embedded:false,exported:true,typ:$Float64,tag:""},{prop:"ReleaseTriggerType",name:"ReleaseTriggerType",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"Damage",name:"Damage",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderJoinIndex",name:"OffenderJoinIndex",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"OffenderPlayerId",name:"OffenderPlayerId",embedded:false,exported:true,typ:$Int32,tag:""}]);K.init("",[{prop:"Id",name:"Id",embedded:false,exported:true,typ:$Int32,tag:""},{prop:"PlayersArr",name:"PlayersArr",embedded:false,exported:true,typ:AM,tag:""},{prop:"CountdownNanos",name:"CountdownNanos",embedded:false,exported:true,typ:$Int64,tag:""},{prop:"MeleeBullets",name:"MeleeBullets",embedded:false,exported:true,typ:AR,tag:""},{prop:"BackendUnconfirmedMask",name:"BackendUnconfirmedMask",embedded:false,exported:true,typ:$Uint64,tag:""},{prop:"ShouldForceResync",name:"ShouldForceResync",embedded:false,exported:true,typ:$Bool,tag:""},{prop:"Players",name:"Players",embedded:false,exported:true,typ:AW,tag:""}]);N.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:A.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;}$r=C.$init();$s=3;case 3:if($c){$c=false;$r=$r.$blk();}if($r&&$r.$blk!==undefined){break s;}$pkg.DIRECTION_DECODER=new AE([new AD([0,0]),new AD([0,2]),new AD([0,-2]),new AD([2,0]),new AD([-2,0]),new AD([1,1]),new AD([-1,-1]),new AD([1,-1]),new AD([-1,1])]);}return;}if($f===undefined){$f={$blk:$init};}$f.$s=$s;$f.$r=$r;return $f;};$pkg.$init=$init;return $pkg;})(); +$packages["jsexport"]=(function(){var $pkg={},$init,A,B,C,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR,AS,D,E,F,G,H,I,J,K,L,M,N,O,P;A=$packages["github.com/gopherjs/gopherjs/js"];B=$packages["github.com/solarlune/resolv"];C=$packages["jsexport/battle"];Q=$ptrType(C.Vec2D);R=$sliceType(Q);S=$ptrType(C.Polygon2D);T=$ptrType(C.PlayerDownsync);U=$sliceType(T);V=$ptrType(C.MeleeBullet);W=$sliceType(V);X=$ptrType(A.Object);Y=$sliceType(X);Z=$sliceType($String);AA=$funcType([$Float64,$Float64],[X],false);AB=$funcType([Q,R],[X],false);AC=$funcType([S],[X],false);AD=$funcType([$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Int32,$Bool,$Float64],[X],false);AE=$funcType([$Int32,U,W],[X],false);AF=$funcType([$Int,$Int,$Int,$Int],[X],false);AG=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$emptyInterface,$String],[X],false);AH=$funcType([S,$Float64,$Float64,$emptyInterface,$String],[X],false);AI=$ptrType(C.RoomDownsyncFrame);AJ=$funcType([AI],[Y],false);AK=$ptrType(B.Space);AL=$funcType([AK],[Y],false);AM=$sliceType($Uint64);AN=$ptrType(B.Object);AO=$mapType($Int32,AN);AP=$funcType([AM,AM,AI,AK,AO,$Int32,$Int32,$Int32,$Int32,$Int32,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[X],false);AQ=$funcType([$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64,$Float64],[$Float64,$Float64],false);AR=$funcType([AN,$Float64,$Float64],[X],false);AS=$mapType($String,$emptyInterface);D=function(a,b,c,d){var a,b,c,d;return A.MakeWrapper(B.NewSpace(a,b,c,d));};$pkg.NewCollisionSpaceJs=D;E=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new C.Vec2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:E,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewVec2DJs=E;F=function(a,b){var{a,b,c,d,$s,$r,$c}=$restore(this,{a,b});$s=$s||0;s:while(true){switch($s){case 0:c=A.MakeFullWrapper(new C.Polygon2D.ptr(a,b));$s=1;case 1:if($c){$c=false;c=c.$blk();}if(c&&c.$blk!==undefined){break s;}d=c;$s=2;case 2:return d;}return;}var $f={$blk:F,$c:true,$r,a,b,c,d,$s};return $f;};$pkg.NewPolygon2DJs=F;G=function(a){var a;return A.MakeWrapper(new C.Barrier.ptr(a));};$pkg.NewBarrierJs=G;H=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;return A.MakeWrapper(new C.PlayerDownsync.ptr(a,b,c,d,e,f,g,h,i,k,o,false,0,0,0,l,m,j,n,"","",""));};$pkg.NewPlayerDownsyncJs=H;I=function(a,b,c){var{a,b,c,d,e,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=A.MakeFullWrapper(new C.RoomDownsyncFrame.ptr(a,b,new $Int64(0,0),c,new $Uint64(0,0),false,false));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=d;$s=2;case 2:return e;}return;}var $f={$blk:I,$c:true,$r,a,b,c,d,e,$s};return $f;};$pkg.NewRoomDownsyncFrameJs=I;J=function(a){var{a,b,c,d,e,f,g,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=a.Objects();c=$makeSlice(Y,0,b.$length);d=b;e=0;case 1:if(!(e=d.$length)?($throwRuntimeError("index out of range"),undefined):d.$array[d.$offset+e]);g=A.MakeFullWrapper(f);$s=3;case 3:if($c){$c=false;g=g.$blk();}if(g&&g.$blk!==undefined){break s;}c=$append(c,g);e++;$s=1;continue;case 2:$s=-1;return c;}return;}var $f={$blk:J,$c:true,$r,a,b,c,d,e,f,g,$s};return $f;};$pkg.GetCollisionSpaceObjsJs=J;K=function(a){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{a});$s=$s||0;s:while(true){switch($s){case 0:b=$makeSlice(Y,0,a.PlayersArr.$length);c=a.PlayersArr;d=0;case 1:if(!(d=c.$length)?($throwRuntimeError("index out of range"),undefined):c.$array[c.$offset+d]);f=A.MakeFullWrapper(e);$s=3;case 3:if($c){$c=false;f=f.$blk();}if(f&&f.$blk!==undefined){break s;}b=$append(b,f);d++;$s=1;continue;case 2:$s=-1;return b;}return;}var $f={$blk:K,$c:true,$r,a,b,c,d,e,f,$s};return $f;};$pkg.GetPlayersArrJs=K;L=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,$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=C.GenerateRectCollider(a,b,c,d,e,f,g,h,i,j,k,l);$s=1;case 1:if($c){$c=false;m=m.$blk();}if(m&&m.$blk!==undefined){break s;}n=A.MakeFullWrapper(m);$s=2;case 2:if($c){$c=false;n=n.$blk();}if(n&&n.$blk!==undefined){break s;}o=n;$s=3;case 3:return o;}return;}var $f={$blk:L,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,$s};return $f;};$pkg.GenerateRectColliderJs=L;M=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=C.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.MakeFullWrapper(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:M,$c:true,$r,a,b,c,d,e,f,g,h,$s};return $f;};$pkg.GenerateConvexPolygonColliderJs=M;N=function(a,b,c){var{a,b,c,d,e,f,$s,$r,$c}=$restore(this,{a,b,c});$s=$s||0;s:while(true){switch($s){case 0:d=a.Check(b,c,new Z([]));$s=1;case 1:if($c){$c=false;d=d.$blk();}if(d&&d.$blk!==undefined){break s;}e=A.MakeFullWrapper(d);$s=2;case 2:if($c){$c=false;e=e.$blk();}if(e&&e.$blk!==undefined){break s;}f=e;$s=3;case 3:return f;}return;}var $f={$blk:N,$c:true,$r,a,b,c,d,e,f,$s};return $f;};$pkg.CheckCollisionJs=N;O=function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){var{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s,$r,$c}=$restore(this,{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p});$s=$s||0;s:while(true){switch($s){case 0:q=C.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p);$s=1;case 1:if($c){$c=false;q=q.$blk();}if(q&&q.$blk!==undefined){break s;}r=A.MakeFullWrapper(q);$s=2;case 2:if($c){$c=false;r=r.$blk();}if(r&&r.$blk!==undefined){break s;}s=r;$s=3;case 3:return s;}return;}var $f={$blk:O,$c:true,$r,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,$s};return $f;};$pkg.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs=O;P=function(){$global.gopkgs=$externalize($makeMap($String.keyFor,[{k:"NewVec2DJs",v:new AA(E)},{k:"NewPolygon2DJs",v:new AB(F)},{k:"NewBarrierJs",v:new AC(G)},{k:"NewPlayerDownsyncJs",v:new AD(H)},{k:"NewRoomDownsyncFrameJs",v:new AE(I)},{k:"NewCollisionSpaceJs",v:new AF(D)},{k:"GenerateRectColliderJs",v:new AG(L)},{k:"GenerateConvexPolygonColliderJs",v:new AH(M)},{k:"GetPlayersArrJs",v:new AJ(K)},{k:"GetCollisionSpaceObjsJs",v:new AL(J)},{k:"ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs",v:new AP(O)},{k:"WorldToPolygonColliderBLPos",v:new AQ(C.WorldToPolygonColliderBLPos)},{k:"PolygonColliderBLToWorldPos",v:new AQ(C.PolygonColliderBLToWorldPos)},{k:"CheckCollisionJs",v:new AR(N)}]),AS);};$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){P();$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/assets/resources/pbfiles/room_downsync_frame.proto b/frontend/assets/resources/pbfiles/room_downsync_frame.proto index dd1724f..9a4a8c1 100644 --- a/frontend/assets/resources/pbfiles/room_downsync_frame.proto +++ b/frontend/assets/resources/pbfiles/room_downsync_frame.proto @@ -79,10 +79,6 @@ message InputsBufferSnapshot { bool shouldForceResync = 4; } -message Barrier { - sharedprotos.Polygon2D boundary = 1; -} - message MeleeBullet { // Jargon reference https://www.thegamer.com/fighting-games-frame-data-explained/ // ALL lengths are in world coordinate @@ -94,60 +90,62 @@ message MeleeBullet { int32 recoveryFrames = 4; int32 recoveryFramesOnBlock = 5; int32 recoveryFramesOnHit = 6; - sharedprotos.Vec2D moveforward = 7; - double hitboxOffset = 8; - sharedprotos.Vec2D hitboxSize = 9; - int32 originatedRenderFrameId = 10; + double hitboxOffset = 7; + int32 originatedRenderFrameId = 8; // for defender - int32 hitStunFrames = 11; - int32 blockStunFrames = 12; - double pushback = 13; + int32 hitStunFrames = 9; + int32 blockStunFrames = 10; + double pushback = 11; - int32 releaseTriggerType = 14; // 1: rising-edge, 2: falling-edge - int32 damage = 15; + int32 releaseTriggerType = 12; // 1: rising-edge, 2: falling-edge + int32 damage = 13; - int32 offenderJoinIndex = 16; - int32 offenderPlayerId = 17; + int32 offenderJoinIndex = 14; + int32 offenderPlayerId = 15; + + double hitboxSizeX = 16; + double hitboxSizeY = 17; + + double selfMoveforwardX = 18; + double selfMoveforwardY = 19; } message BattleColliderInfo { string stageName = 1; - map strToVec2DListMap = 2; - map strToPolygon2DListMap = 3; - int32 stageDiscreteW = 4; - int32 stageDiscreteH = 5; - int32 stageTileW = 6; - int32 stageTileH = 7; + int32 stageDiscreteW = 2; + int32 stageDiscreteH = 3; + int32 stageTileW = 4; + int32 stageTileH = 5; - int32 intervalToPing = 8; - int32 willKickIfInactiveFor = 9; - int32 boundRoomId = 10; - int32 battleDurationFrames = 12; - int64 battleDurationNanos = 13; - int32 serverFps = 14; - int32 inputDelayFrames = 15; // in the count of render frames - uint32 inputScaleFrames = 16; // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) - int32 nstDelayFrames = 17; // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames" - int32 inputFrameUpsyncDelayTolerance = 18; - int32 maxChasingRenderFramesPerUpdate = 19; - int32 playerBattleState = 20; - double rollbackEstimatedDtMillis = 21; - int64 rollbackEstimatedDtNanos = 22; + int32 intervalToPing = 6; + int32 willKickIfInactiveFor = 7; + int32 boundRoomId = 8; + int32 battleDurationFrames = 9; + int64 battleDurationNanos = 10; + int32 serverFps = 11; + int32 inputDelayFrames = 12; // in the count of render frames + uint32 inputScaleFrames = 13; // inputDelayedAndScaledFrameId = ((originalFrameId - InputDelayFrames) >> InputScaleFrames) + int32 nstDelayFrames = 14; // network-single-trip delay in the count of render frames, proposed to be (InputDelayFrames >> 1) because we expect a round-trip delay to be exactly "InputDelayFrames" + int32 inputFrameUpsyncDelayTolerance = 15; + int32 maxChasingRenderFramesPerUpdate = 16; + int32 playerBattleState = 17; + double rollbackEstimatedDtMillis = 18; + int64 rollbackEstimatedDtNanos = 19; - double worldToVirtualGridRatio = 23; - double virtualGridToWorldRatio = 24; + double worldToVirtualGridRatio = 20; + double virtualGridToWorldRatio = 21; - int32 spAtkLookupFrames = 25; - int32 renderCacheSize = 26; + int32 spAtkLookupFrames = 22; + int32 renderCacheSize = 23; - map meleeSkillConfig = 27; // skillId -> skill + map meleeSkillConfig = 24; // skillId -> skill - double snapIntoPlatformOverlap = 28; - double snapIntoPlatformThreshold = 29; - int32 jumpingInitVelY = 30; - int32 gravityX = 31; - int32 gravityY = 32; + double snapIntoPlatformOverlap = 25; + double snapIntoPlatformThreshold = 26; + int32 jumpingInitVelY = 27; + int32 gravityX = 28; + int32 gravityY = 29; } message RoomDownsyncFrame { diff --git a/frontend/assets/scripts/OfflineMapBackend.js b/frontend/assets/scripts/OfflineMapBackend.js index ce3909d..9e81845 100644 --- a/frontend/assets/scripts/OfflineMapBackend.js +++ b/frontend/assets/scripts/OfflineMapBackend.js @@ -294,11 +294,9 @@ cc.Class({ throw `Failed to get cached delayedInputFrame for i=${i}, j=${j}, renderFrameId=${self.renderFrameId}, lastUpsyncInputFrameId=${self.lastUpsyncInputFrameId}, lastAllConfirmedInputFrameId=${self.lastAllConfirmedInputFrameId}, chaserRenderFrameId=${self.chaserRenderFrameId}; recentRenderCache=${self._stringifyRecentRenderCache(false)}, recentInputCache=${self._stringifyRecentInputCache(false)}`; } - const delayedInputFrameJs = gopkgs.NewInputFrameDownsyncJs(j, delayedInputFrame.inputList, delayedInputFrame.confirmedList); const jPrev = self._convertToInputFrameId(i - 1, self.inputDelayFrames); const delayedInputFrameForPrevRenderFrame = self.recentInputCache.getByFrameId(jPrev); - const delayedInputFrameForPrevRenderFrameJs = gopkgs.NewInputFrameDownsyncJs(jPrev, delayedInputFrameForPrevRenderFrame.inputList, delayedInputFrameForPrevRenderFrame.confirmedList); - const nextRdf = gopkgs.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(delayedInputFrameJs, delayedInputFrameForPrevRenderFrameJs, currRdf, collisionSys, collisionSysMap, self.gravityX, self.gravityY, self.jumpingInitVelY, self.inputDelayFrames, self.inputScaleFrames, self.spaceOffsetX, self.spaceOffsetY, self.snapIntoPlatformOverlap, self.snapIntoPlatformThreshold, self.worldToVirtualGridRatio, self.virtualGridToWorldRatio); + const nextRdf = gopkgs.ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(delayedInputFrame.inputList, (null == delayedInputFrameForPrevRenderFrame ? null : delayedInputFrameForPrevRenderFrame.inputList), currRdf, collisionSys, collisionSysMap, self.gravityX, self.gravityY, self.jumpingInitVelY, self.inputDelayFrames, self.inputScaleFrames, self.spaceOffsetX, self.spaceOffsetY, self.snapIntoPlatformOverlap, self.snapIntoPlatformThreshold, self.worldToVirtualGridRatio, self.virtualGridToWorldRatio); if (true == isChasing) { // [WARNING] Move the cursor "self.chaserRenderFrameId" when "true == isChasing", keep in mind that "self.chaserRenderFrameId" is not monotonic! diff --git a/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js b/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js index 47bd928..6e89a80 100644 --- a/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js +++ b/frontend/assets/scripts/modules/room_downsync_frame_proto_bundle.forcemsg.js @@ -3954,214 +3954,6 @@ $root.protos = (function() { return InputsBufferSnapshot; })(); - protos.Barrier = (function() { - - /** - * Properties of a Barrier. - * @memberof protos - * @interface IBarrier - * @property {sharedprotos.Polygon2D|null} [boundary] Barrier boundary - */ - - /** - * Constructs a new Barrier. - * @memberof protos - * @classdesc Represents a Barrier. - * @implements IBarrier - * @constructor - * @param {protos.IBarrier=} [properties] Properties to set - */ - function Barrier(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Barrier boundary. - * @member {sharedprotos.Polygon2D|null|undefined} boundary - * @memberof protos.Barrier - * @instance - */ - Barrier.prototype.boundary = null; - - /** - * Creates a new Barrier instance using the specified properties. - * @function create - * @memberof protos.Barrier - * @static - * @param {protos.IBarrier=} [properties] Properties to set - * @returns {protos.Barrier} Barrier instance - */ - Barrier.create = function create(properties) { - return new Barrier(properties); - }; - - /** - * Encodes the specified Barrier message. Does not implicitly {@link protos.Barrier.verify|verify} messages. - * @function encode - * @memberof protos.Barrier - * @static - * @param {protos.Barrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.boundary != null && Object.hasOwnProperty.call(message, "boundary")) - $root.sharedprotos.Polygon2D.encode(message.boundary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Barrier message, length delimited. Does not implicitly {@link protos.Barrier.verify|verify} messages. - * @function encodeDelimited - * @memberof protos.Barrier - * @static - * @param {protos.Barrier} message Barrier message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Barrier.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Barrier message from the specified reader or buffer. - * @function decode - * @memberof protos.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {protos.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.protos.Barrier(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.boundary = $root.sharedprotos.Polygon2D.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Barrier message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof protos.Barrier - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {protos.Barrier} Barrier - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Barrier.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Barrier message. - * @function verify - * @memberof protos.Barrier - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Barrier.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.boundary != null && message.hasOwnProperty("boundary")) { - var error = $root.sharedprotos.Polygon2D.verify(message.boundary); - if (error) - return "boundary." + error; - } - return null; - }; - - /** - * Creates a Barrier message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof protos.Barrier - * @static - * @param {Object.} object Plain object - * @returns {protos.Barrier} Barrier - */ - Barrier.fromObject = function fromObject(object) { - if (object instanceof $root.protos.Barrier) - return object; - var message = new $root.protos.Barrier(); - if (object.boundary != null) { - if (typeof object.boundary !== "object") - throw TypeError(".protos.Barrier.boundary: object expected"); - message.boundary = $root.sharedprotos.Polygon2D.fromObject(object.boundary); - } - return message; - }; - - /** - * Creates a plain object from a Barrier message. Also converts values to other types if specified. - * @function toObject - * @memberof protos.Barrier - * @static - * @param {protos.Barrier} message Barrier - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Barrier.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.boundary = null; - if (message.boundary != null && message.hasOwnProperty("boundary")) - object.boundary = $root.sharedprotos.Polygon2D.toObject(message.boundary, options); - return object; - }; - - /** - * Converts this Barrier to JSON. - * @function toJSON - * @memberof protos.Barrier - * @instance - * @returns {Object.} JSON object - */ - Barrier.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Barrier - * @function getTypeUrl - * @memberof protos.Barrier - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Barrier.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/protos.Barrier"; - }; - - return Barrier; - })(); - protos.MeleeBullet = (function() { /** @@ -4174,9 +3966,7 @@ $root.protos = (function() { * @property {number|null} [recoveryFrames] MeleeBullet recoveryFrames * @property {number|null} [recoveryFramesOnBlock] MeleeBullet recoveryFramesOnBlock * @property {number|null} [recoveryFramesOnHit] MeleeBullet recoveryFramesOnHit - * @property {sharedprotos.Vec2D|null} [moveforward] MeleeBullet moveforward * @property {number|null} [hitboxOffset] MeleeBullet hitboxOffset - * @property {sharedprotos.Vec2D|null} [hitboxSize] MeleeBullet hitboxSize * @property {number|null} [originatedRenderFrameId] MeleeBullet originatedRenderFrameId * @property {number|null} [hitStunFrames] MeleeBullet hitStunFrames * @property {number|null} [blockStunFrames] MeleeBullet blockStunFrames @@ -4185,6 +3975,10 @@ $root.protos = (function() { * @property {number|null} [damage] MeleeBullet damage * @property {number|null} [offenderJoinIndex] MeleeBullet offenderJoinIndex * @property {number|null} [offenderPlayerId] MeleeBullet offenderPlayerId + * @property {number|null} [hitboxSizeX] MeleeBullet hitboxSizeX + * @property {number|null} [hitboxSizeY] MeleeBullet hitboxSizeY + * @property {number|null} [selfMoveforwardX] MeleeBullet selfMoveforwardX + * @property {number|null} [selfMoveforwardY] MeleeBullet selfMoveforwardY */ /** @@ -4250,14 +4044,6 @@ $root.protos = (function() { */ MeleeBullet.prototype.recoveryFramesOnHit = 0; - /** - * MeleeBullet moveforward. - * @member {sharedprotos.Vec2D|null|undefined} moveforward - * @memberof protos.MeleeBullet - * @instance - */ - MeleeBullet.prototype.moveforward = null; - /** * MeleeBullet hitboxOffset. * @member {number} hitboxOffset @@ -4266,14 +4052,6 @@ $root.protos = (function() { */ MeleeBullet.prototype.hitboxOffset = 0; - /** - * MeleeBullet hitboxSize. - * @member {sharedprotos.Vec2D|null|undefined} hitboxSize - * @memberof protos.MeleeBullet - * @instance - */ - MeleeBullet.prototype.hitboxSize = null; - /** * MeleeBullet originatedRenderFrameId. * @member {number} originatedRenderFrameId @@ -4338,6 +4116,38 @@ $root.protos = (function() { */ MeleeBullet.prototype.offenderPlayerId = 0; + /** + * MeleeBullet hitboxSizeX. + * @member {number} hitboxSizeX + * @memberof protos.MeleeBullet + * @instance + */ + MeleeBullet.prototype.hitboxSizeX = 0; + + /** + * MeleeBullet hitboxSizeY. + * @member {number} hitboxSizeY + * @memberof protos.MeleeBullet + * @instance + */ + MeleeBullet.prototype.hitboxSizeY = 0; + + /** + * MeleeBullet selfMoveforwardX. + * @member {number} selfMoveforwardX + * @memberof protos.MeleeBullet + * @instance + */ + MeleeBullet.prototype.selfMoveforwardX = 0; + + /** + * MeleeBullet selfMoveforwardY. + * @member {number} selfMoveforwardY + * @memberof protos.MeleeBullet + * @instance + */ + MeleeBullet.prototype.selfMoveforwardY = 0; + /** * Creates a new MeleeBullet instance using the specified properties. * @function create @@ -4374,28 +4184,32 @@ $root.protos = (function() { writer.uint32(/* id 5, wireType 0 =*/40).int32(message.recoveryFramesOnBlock); if (message.recoveryFramesOnHit != null && Object.hasOwnProperty.call(message, "recoveryFramesOnHit")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.recoveryFramesOnHit); - if (message.moveforward != null && Object.hasOwnProperty.call(message, "moveforward")) - $root.sharedprotos.Vec2D.encode(message.moveforward, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.hitboxOffset != null && Object.hasOwnProperty.call(message, "hitboxOffset")) - writer.uint32(/* id 8, wireType 1 =*/65).double(message.hitboxOffset); - if (message.hitboxSize != null && Object.hasOwnProperty.call(message, "hitboxSize")) - $root.sharedprotos.Vec2D.encode(message.hitboxSize, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + writer.uint32(/* id 7, wireType 1 =*/57).double(message.hitboxOffset); if (message.originatedRenderFrameId != null && Object.hasOwnProperty.call(message, "originatedRenderFrameId")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.originatedRenderFrameId); + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.originatedRenderFrameId); if (message.hitStunFrames != null && Object.hasOwnProperty.call(message, "hitStunFrames")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.hitStunFrames); + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.hitStunFrames); if (message.blockStunFrames != null && Object.hasOwnProperty.call(message, "blockStunFrames")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.blockStunFrames); + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.blockStunFrames); if (message.pushback != null && Object.hasOwnProperty.call(message, "pushback")) - writer.uint32(/* id 13, wireType 1 =*/105).double(message.pushback); + writer.uint32(/* id 11, wireType 1 =*/89).double(message.pushback); if (message.releaseTriggerType != null && Object.hasOwnProperty.call(message, "releaseTriggerType")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.releaseTriggerType); + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.releaseTriggerType); if (message.damage != null && Object.hasOwnProperty.call(message, "damage")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.damage); + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.damage); if (message.offenderJoinIndex != null && Object.hasOwnProperty.call(message, "offenderJoinIndex")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.offenderJoinIndex); + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.offenderJoinIndex); if (message.offenderPlayerId != null && Object.hasOwnProperty.call(message, "offenderPlayerId")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.offenderPlayerId); + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.offenderPlayerId); + if (message.hitboxSizeX != null && Object.hasOwnProperty.call(message, "hitboxSizeX")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.hitboxSizeX); + if (message.hitboxSizeY != null && Object.hasOwnProperty.call(message, "hitboxSizeY")) + writer.uint32(/* id 17, wireType 1 =*/137).double(message.hitboxSizeY); + if (message.selfMoveforwardX != null && Object.hasOwnProperty.call(message, "selfMoveforwardX")) + writer.uint32(/* id 18, wireType 1 =*/145).double(message.selfMoveforwardX); + if (message.selfMoveforwardY != null && Object.hasOwnProperty.call(message, "selfMoveforwardY")) + writer.uint32(/* id 19, wireType 1 =*/153).double(message.selfMoveforwardY); return writer; }; @@ -4455,49 +4269,57 @@ $root.protos = (function() { break; } case 7: { - message.moveforward = $root.sharedprotos.Vec2D.decode(reader, reader.uint32()); - break; - } - case 8: { message.hitboxOffset = reader.double(); break; } - case 9: { - message.hitboxSize = $root.sharedprotos.Vec2D.decode(reader, reader.uint32()); - break; - } - case 10: { + case 8: { message.originatedRenderFrameId = reader.int32(); break; } - case 11: { + case 9: { message.hitStunFrames = reader.int32(); break; } - case 12: { + case 10: { message.blockStunFrames = reader.int32(); break; } - case 13: { + case 11: { message.pushback = reader.double(); break; } - case 14: { + case 12: { message.releaseTriggerType = reader.int32(); break; } - case 15: { + case 13: { message.damage = reader.int32(); break; } - case 16: { + case 14: { message.offenderJoinIndex = reader.int32(); break; } - case 17: { + case 15: { message.offenderPlayerId = reader.int32(); break; } + case 16: { + message.hitboxSizeX = reader.double(); + break; + } + case 17: { + message.hitboxSizeY = reader.double(); + break; + } + case 18: { + message.selfMoveforwardX = reader.double(); + break; + } + case 19: { + message.selfMoveforwardY = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -4551,19 +4373,9 @@ $root.protos = (function() { if (message.recoveryFramesOnHit != null && message.hasOwnProperty("recoveryFramesOnHit")) if (!$util.isInteger(message.recoveryFramesOnHit)) return "recoveryFramesOnHit: integer expected"; - if (message.moveforward != null && message.hasOwnProperty("moveforward")) { - var error = $root.sharedprotos.Vec2D.verify(message.moveforward); - if (error) - return "moveforward." + error; - } if (message.hitboxOffset != null && message.hasOwnProperty("hitboxOffset")) if (typeof message.hitboxOffset !== "number") return "hitboxOffset: number expected"; - if (message.hitboxSize != null && message.hasOwnProperty("hitboxSize")) { - var error = $root.sharedprotos.Vec2D.verify(message.hitboxSize); - if (error) - return "hitboxSize." + error; - } if (message.originatedRenderFrameId != null && message.hasOwnProperty("originatedRenderFrameId")) if (!$util.isInteger(message.originatedRenderFrameId)) return "originatedRenderFrameId: integer expected"; @@ -4588,6 +4400,18 @@ $root.protos = (function() { if (message.offenderPlayerId != null && message.hasOwnProperty("offenderPlayerId")) if (!$util.isInteger(message.offenderPlayerId)) return "offenderPlayerId: integer expected"; + if (message.hitboxSizeX != null && message.hasOwnProperty("hitboxSizeX")) + if (typeof message.hitboxSizeX !== "number") + return "hitboxSizeX: number expected"; + if (message.hitboxSizeY != null && message.hasOwnProperty("hitboxSizeY")) + if (typeof message.hitboxSizeY !== "number") + return "hitboxSizeY: number expected"; + if (message.selfMoveforwardX != null && message.hasOwnProperty("selfMoveforwardX")) + if (typeof message.selfMoveforwardX !== "number") + return "selfMoveforwardX: number expected"; + if (message.selfMoveforwardY != null && message.hasOwnProperty("selfMoveforwardY")) + if (typeof message.selfMoveforwardY !== "number") + return "selfMoveforwardY: number expected"; return null; }; @@ -4615,18 +4439,8 @@ $root.protos = (function() { message.recoveryFramesOnBlock = object.recoveryFramesOnBlock | 0; if (object.recoveryFramesOnHit != null) message.recoveryFramesOnHit = object.recoveryFramesOnHit | 0; - if (object.moveforward != null) { - if (typeof object.moveforward !== "object") - throw TypeError(".protos.MeleeBullet.moveforward: object expected"); - message.moveforward = $root.sharedprotos.Vec2D.fromObject(object.moveforward); - } if (object.hitboxOffset != null) message.hitboxOffset = Number(object.hitboxOffset); - if (object.hitboxSize != null) { - if (typeof object.hitboxSize !== "object") - throw TypeError(".protos.MeleeBullet.hitboxSize: object expected"); - message.hitboxSize = $root.sharedprotos.Vec2D.fromObject(object.hitboxSize); - } if (object.originatedRenderFrameId != null) message.originatedRenderFrameId = object.originatedRenderFrameId | 0; if (object.hitStunFrames != null) @@ -4643,6 +4457,14 @@ $root.protos = (function() { message.offenderJoinIndex = object.offenderJoinIndex | 0; if (object.offenderPlayerId != null) message.offenderPlayerId = object.offenderPlayerId | 0; + if (object.hitboxSizeX != null) + message.hitboxSizeX = Number(object.hitboxSizeX); + if (object.hitboxSizeY != null) + message.hitboxSizeY = Number(object.hitboxSizeY); + if (object.selfMoveforwardX != null) + message.selfMoveforwardX = Number(object.selfMoveforwardX); + if (object.selfMoveforwardY != null) + message.selfMoveforwardY = Number(object.selfMoveforwardY); return message; }; @@ -4666,9 +4488,7 @@ $root.protos = (function() { object.recoveryFrames = 0; object.recoveryFramesOnBlock = 0; object.recoveryFramesOnHit = 0; - object.moveforward = null; object.hitboxOffset = 0; - object.hitboxSize = null; object.originatedRenderFrameId = 0; object.hitStunFrames = 0; object.blockStunFrames = 0; @@ -4677,6 +4497,10 @@ $root.protos = (function() { object.damage = 0; object.offenderJoinIndex = 0; object.offenderPlayerId = 0; + object.hitboxSizeX = 0; + object.hitboxSizeY = 0; + object.selfMoveforwardX = 0; + object.selfMoveforwardY = 0; } if (message.battleLocalId != null && message.hasOwnProperty("battleLocalId")) object.battleLocalId = message.battleLocalId; @@ -4690,12 +4514,8 @@ $root.protos = (function() { object.recoveryFramesOnBlock = message.recoveryFramesOnBlock; if (message.recoveryFramesOnHit != null && message.hasOwnProperty("recoveryFramesOnHit")) object.recoveryFramesOnHit = message.recoveryFramesOnHit; - if (message.moveforward != null && message.hasOwnProperty("moveforward")) - object.moveforward = $root.sharedprotos.Vec2D.toObject(message.moveforward, options); if (message.hitboxOffset != null && message.hasOwnProperty("hitboxOffset")) object.hitboxOffset = options.json && !isFinite(message.hitboxOffset) ? String(message.hitboxOffset) : message.hitboxOffset; - if (message.hitboxSize != null && message.hasOwnProperty("hitboxSize")) - object.hitboxSize = $root.sharedprotos.Vec2D.toObject(message.hitboxSize, options); if (message.originatedRenderFrameId != null && message.hasOwnProperty("originatedRenderFrameId")) object.originatedRenderFrameId = message.originatedRenderFrameId; if (message.hitStunFrames != null && message.hasOwnProperty("hitStunFrames")) @@ -4712,6 +4532,14 @@ $root.protos = (function() { object.offenderJoinIndex = message.offenderJoinIndex; if (message.offenderPlayerId != null && message.hasOwnProperty("offenderPlayerId")) object.offenderPlayerId = message.offenderPlayerId; + if (message.hitboxSizeX != null && message.hasOwnProperty("hitboxSizeX")) + object.hitboxSizeX = options.json && !isFinite(message.hitboxSizeX) ? String(message.hitboxSizeX) : message.hitboxSizeX; + if (message.hitboxSizeY != null && message.hasOwnProperty("hitboxSizeY")) + object.hitboxSizeY = options.json && !isFinite(message.hitboxSizeY) ? String(message.hitboxSizeY) : message.hitboxSizeY; + if (message.selfMoveforwardX != null && message.hasOwnProperty("selfMoveforwardX")) + object.selfMoveforwardX = options.json && !isFinite(message.selfMoveforwardX) ? String(message.selfMoveforwardX) : message.selfMoveforwardX; + if (message.selfMoveforwardY != null && message.hasOwnProperty("selfMoveforwardY")) + object.selfMoveforwardY = options.json && !isFinite(message.selfMoveforwardY) ? String(message.selfMoveforwardY) : message.selfMoveforwardY; return object; }; @@ -4751,8 +4579,6 @@ $root.protos = (function() { * @memberof protos * @interface IBattleColliderInfo * @property {string|null} [stageName] BattleColliderInfo stageName - * @property {Object.|null} [strToVec2DListMap] BattleColliderInfo strToVec2DListMap - * @property {Object.|null} [strToPolygon2DListMap] BattleColliderInfo strToPolygon2DListMap * @property {number|null} [stageDiscreteW] BattleColliderInfo stageDiscreteW * @property {number|null} [stageDiscreteH] BattleColliderInfo stageDiscreteH * @property {number|null} [stageTileW] BattleColliderInfo stageTileW @@ -4792,8 +4618,6 @@ $root.protos = (function() { * @param {protos.IBattleColliderInfo=} [properties] Properties to set */ function BattleColliderInfo(properties) { - this.strToVec2DListMap = {}; - this.strToPolygon2DListMap = {}; this.meleeSkillConfig = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -4809,22 +4633,6 @@ $root.protos = (function() { */ BattleColliderInfo.prototype.stageName = ""; - /** - * BattleColliderInfo strToVec2DListMap. - * @member {Object.} strToVec2DListMap - * @memberof protos.BattleColliderInfo - * @instance - */ - BattleColliderInfo.prototype.strToVec2DListMap = $util.emptyObject; - - /** - * BattleColliderInfo strToPolygon2DListMap. - * @member {Object.} strToPolygon2DListMap - * @memberof protos.BattleColliderInfo - * @instance - */ - BattleColliderInfo.prototype.strToPolygon2DListMap = $util.emptyObject; - /** * BattleColliderInfo stageDiscreteW. * @member {number} stageDiscreteW @@ -5075,75 +4883,65 @@ $root.protos = (function() { writer = $Writer.create(); if (message.stageName != null && Object.hasOwnProperty.call(message, "stageName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.stageName); - if (message.strToVec2DListMap != null && Object.hasOwnProperty.call(message, "strToVec2DListMap")) - for (var keys = Object.keys(message.strToVec2DListMap), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.sharedprotos.Vec2DList.encode(message.strToVec2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.strToPolygon2DListMap != null && Object.hasOwnProperty.call(message, "strToPolygon2DListMap")) - for (var keys = Object.keys(message.strToPolygon2DListMap), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.sharedprotos.Polygon2DList.encode(message.strToPolygon2DListMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } if (message.stageDiscreteW != null && Object.hasOwnProperty.call(message, "stageDiscreteW")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.stageDiscreteW); + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stageDiscreteW); if (message.stageDiscreteH != null && Object.hasOwnProperty.call(message, "stageDiscreteH")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.stageDiscreteH); + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.stageDiscreteH); if (message.stageTileW != null && Object.hasOwnProperty.call(message, "stageTileW")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.stageTileW); + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.stageTileW); if (message.stageTileH != null && Object.hasOwnProperty.call(message, "stageTileH")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.stageTileH); + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.stageTileH); if (message.intervalToPing != null && Object.hasOwnProperty.call(message, "intervalToPing")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.intervalToPing); + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.intervalToPing); if (message.willKickIfInactiveFor != null && Object.hasOwnProperty.call(message, "willKickIfInactiveFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.willKickIfInactiveFor); + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.willKickIfInactiveFor); if (message.boundRoomId != null && Object.hasOwnProperty.call(message, "boundRoomId")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.boundRoomId); + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.boundRoomId); if (message.battleDurationFrames != null && Object.hasOwnProperty.call(message, "battleDurationFrames")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.battleDurationFrames); + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.battleDurationFrames); if (message.battleDurationNanos != null && Object.hasOwnProperty.call(message, "battleDurationNanos")) - writer.uint32(/* id 13, wireType 0 =*/104).int64(message.battleDurationNanos); + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.battleDurationNanos); if (message.serverFps != null && Object.hasOwnProperty.call(message, "serverFps")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.serverFps); + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.serverFps); if (message.inputDelayFrames != null && Object.hasOwnProperty.call(message, "inputDelayFrames")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.inputDelayFrames); + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.inputDelayFrames); if (message.inputScaleFrames != null && Object.hasOwnProperty.call(message, "inputScaleFrames")) - writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.inputScaleFrames); + writer.uint32(/* id 13, wireType 0 =*/104).uint32(message.inputScaleFrames); if (message.nstDelayFrames != null && Object.hasOwnProperty.call(message, "nstDelayFrames")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.nstDelayFrames); + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.nstDelayFrames); if (message.inputFrameUpsyncDelayTolerance != null && Object.hasOwnProperty.call(message, "inputFrameUpsyncDelayTolerance")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.inputFrameUpsyncDelayTolerance); + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.inputFrameUpsyncDelayTolerance); if (message.maxChasingRenderFramesPerUpdate != null && Object.hasOwnProperty.call(message, "maxChasingRenderFramesPerUpdate")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.maxChasingRenderFramesPerUpdate); + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.maxChasingRenderFramesPerUpdate); if (message.playerBattleState != null && Object.hasOwnProperty.call(message, "playerBattleState")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.playerBattleState); + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.playerBattleState); if (message.rollbackEstimatedDtMillis != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDtMillis")) - writer.uint32(/* id 21, wireType 1 =*/169).double(message.rollbackEstimatedDtMillis); + writer.uint32(/* id 18, wireType 1 =*/145).double(message.rollbackEstimatedDtMillis); if (message.rollbackEstimatedDtNanos != null && Object.hasOwnProperty.call(message, "rollbackEstimatedDtNanos")) - writer.uint32(/* id 22, wireType 0 =*/176).int64(message.rollbackEstimatedDtNanos); + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.rollbackEstimatedDtNanos); if (message.worldToVirtualGridRatio != null && Object.hasOwnProperty.call(message, "worldToVirtualGridRatio")) - writer.uint32(/* id 23, wireType 1 =*/185).double(message.worldToVirtualGridRatio); + writer.uint32(/* id 20, wireType 1 =*/161).double(message.worldToVirtualGridRatio); if (message.virtualGridToWorldRatio != null && Object.hasOwnProperty.call(message, "virtualGridToWorldRatio")) - writer.uint32(/* id 24, wireType 1 =*/193).double(message.virtualGridToWorldRatio); + writer.uint32(/* id 21, wireType 1 =*/169).double(message.virtualGridToWorldRatio); if (message.spAtkLookupFrames != null && Object.hasOwnProperty.call(message, "spAtkLookupFrames")) - writer.uint32(/* id 25, wireType 0 =*/200).int32(message.spAtkLookupFrames); + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.spAtkLookupFrames); if (message.renderCacheSize != null && Object.hasOwnProperty.call(message, "renderCacheSize")) - writer.uint32(/* id 26, wireType 0 =*/208).int32(message.renderCacheSize); + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.renderCacheSize); if (message.meleeSkillConfig != null && Object.hasOwnProperty.call(message, "meleeSkillConfig")) for (var keys = Object.keys(message.meleeSkillConfig), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 27, wireType 2 =*/218).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); + writer.uint32(/* id 24, wireType 2 =*/194).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]); $root.protos.MeleeBullet.encode(message.meleeSkillConfig[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } if (message.snapIntoPlatformOverlap != null && Object.hasOwnProperty.call(message, "snapIntoPlatformOverlap")) - writer.uint32(/* id 28, wireType 1 =*/225).double(message.snapIntoPlatformOverlap); + writer.uint32(/* id 25, wireType 1 =*/201).double(message.snapIntoPlatformOverlap); if (message.snapIntoPlatformThreshold != null && Object.hasOwnProperty.call(message, "snapIntoPlatformThreshold")) - writer.uint32(/* id 29, wireType 1 =*/233).double(message.snapIntoPlatformThreshold); + writer.uint32(/* id 26, wireType 1 =*/209).double(message.snapIntoPlatformThreshold); if (message.jumpingInitVelY != null && Object.hasOwnProperty.call(message, "jumpingInitVelY")) - writer.uint32(/* id 30, wireType 0 =*/240).int32(message.jumpingInitVelY); + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.jumpingInitVelY); if (message.gravityX != null && Object.hasOwnProperty.call(message, "gravityX")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.gravityX); + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.gravityX); if (message.gravityY != null && Object.hasOwnProperty.call(message, "gravityY")) - writer.uint32(/* id 32, wireType 0 =*/256).int32(message.gravityY); + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.gravityY); return writer; }; @@ -5183,140 +4981,94 @@ $root.protos = (function() { break; } case 2: { - if (message.strToVec2DListMap === $util.emptyObject) - message.strToVec2DListMap = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.sharedprotos.Vec2DList.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.strToVec2DListMap[key] = value; - break; - } - case 3: { - if (message.strToPolygon2DListMap === $util.emptyObject) - message.strToPolygon2DListMap = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.sharedprotos.Polygon2DList.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.strToPolygon2DListMap[key] = value; - break; - } - case 4: { message.stageDiscreteW = reader.int32(); break; } - case 5: { + case 3: { message.stageDiscreteH = reader.int32(); break; } - case 6: { + case 4: { message.stageTileW = reader.int32(); break; } - case 7: { + case 5: { message.stageTileH = reader.int32(); break; } - case 8: { + case 6: { message.intervalToPing = reader.int32(); break; } - case 9: { + case 7: { message.willKickIfInactiveFor = reader.int32(); break; } - case 10: { + case 8: { message.boundRoomId = reader.int32(); break; } - case 12: { + case 9: { message.battleDurationFrames = reader.int32(); break; } - case 13: { + case 10: { message.battleDurationNanos = reader.int64(); break; } - case 14: { + case 11: { message.serverFps = reader.int32(); break; } - case 15: { + case 12: { message.inputDelayFrames = reader.int32(); break; } - case 16: { + case 13: { message.inputScaleFrames = reader.uint32(); break; } - case 17: { + case 14: { message.nstDelayFrames = reader.int32(); break; } - case 18: { + case 15: { message.inputFrameUpsyncDelayTolerance = reader.int32(); break; } - case 19: { + case 16: { message.maxChasingRenderFramesPerUpdate = reader.int32(); break; } - case 20: { + case 17: { message.playerBattleState = reader.int32(); break; } - case 21: { + case 18: { message.rollbackEstimatedDtMillis = reader.double(); break; } - case 22: { + case 19: { message.rollbackEstimatedDtNanos = reader.int64(); break; } - case 23: { + case 20: { message.worldToVirtualGridRatio = reader.double(); break; } - case 24: { + case 21: { message.virtualGridToWorldRatio = reader.double(); break; } - case 25: { + case 22: { message.spAtkLookupFrames = reader.int32(); break; } - case 26: { + case 23: { message.renderCacheSize = reader.int32(); break; } - case 27: { + case 24: { if (message.meleeSkillConfig === $util.emptyObject) message.meleeSkillConfig = {}; var end2 = reader.uint32() + reader.pos; @@ -5339,23 +5091,23 @@ $root.protos = (function() { message.meleeSkillConfig[key] = value; break; } - case 28: { + case 25: { message.snapIntoPlatformOverlap = reader.double(); break; } - case 29: { + case 26: { message.snapIntoPlatformThreshold = reader.double(); break; } - case 30: { + case 27: { message.jumpingInitVelY = reader.int32(); break; } - case 31: { + case 28: { message.gravityX = reader.int32(); break; } - case 32: { + case 29: { message.gravityY = reader.int32(); break; } @@ -5397,26 +5149,6 @@ $root.protos = (function() { if (message.stageName != null && message.hasOwnProperty("stageName")) if (!$util.isString(message.stageName)) return "stageName: string expected"; - if (message.strToVec2DListMap != null && message.hasOwnProperty("strToVec2DListMap")) { - if (!$util.isObject(message.strToVec2DListMap)) - return "strToVec2DListMap: object expected"; - var key = Object.keys(message.strToVec2DListMap); - for (var i = 0; i < key.length; ++i) { - var error = $root.sharedprotos.Vec2DList.verify(message.strToVec2DListMap[key[i]]); - if (error) - return "strToVec2DListMap." + error; - } - } - if (message.strToPolygon2DListMap != null && message.hasOwnProperty("strToPolygon2DListMap")) { - if (!$util.isObject(message.strToPolygon2DListMap)) - return "strToPolygon2DListMap: object expected"; - var key = Object.keys(message.strToPolygon2DListMap); - for (var i = 0; i < key.length; ++i) { - var error = $root.sharedprotos.Polygon2DList.verify(message.strToPolygon2DListMap[key[i]]); - if (error) - return "strToPolygon2DListMap." + error; - } - } if (message.stageDiscreteW != null && message.hasOwnProperty("stageDiscreteW")) if (!$util.isInteger(message.stageDiscreteW)) return "stageDiscreteW: integer expected"; @@ -5529,26 +5261,6 @@ $root.protos = (function() { var message = new $root.protos.BattleColliderInfo(); if (object.stageName != null) message.stageName = String(object.stageName); - if (object.strToVec2DListMap) { - if (typeof object.strToVec2DListMap !== "object") - throw TypeError(".protos.BattleColliderInfo.strToVec2DListMap: object expected"); - message.strToVec2DListMap = {}; - for (var keys = Object.keys(object.strToVec2DListMap), i = 0; i < keys.length; ++i) { - if (typeof object.strToVec2DListMap[keys[i]] !== "object") - throw TypeError(".protos.BattleColliderInfo.strToVec2DListMap: object expected"); - message.strToVec2DListMap[keys[i]] = $root.sharedprotos.Vec2DList.fromObject(object.strToVec2DListMap[keys[i]]); - } - } - if (object.strToPolygon2DListMap) { - if (typeof object.strToPolygon2DListMap !== "object") - throw TypeError(".protos.BattleColliderInfo.strToPolygon2DListMap: object expected"); - message.strToPolygon2DListMap = {}; - for (var keys = Object.keys(object.strToPolygon2DListMap), i = 0; i < keys.length; ++i) { - if (typeof object.strToPolygon2DListMap[keys[i]] !== "object") - throw TypeError(".protos.BattleColliderInfo.strToPolygon2DListMap: object expected"); - message.strToPolygon2DListMap[keys[i]] = $root.sharedprotos.Polygon2DList.fromObject(object.strToPolygon2DListMap[keys[i]]); - } - } if (object.stageDiscreteW != null) message.stageDiscreteW = object.stageDiscreteW | 0; if (object.stageDiscreteH != null) @@ -5643,11 +5355,8 @@ $root.protos = (function() { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) { - object.strToVec2DListMap = {}; - object.strToPolygon2DListMap = {}; + if (options.objects || options.defaults) object.meleeSkillConfig = {}; - } if (options.defaults) { object.stageName = ""; object.stageDiscreteW = 0; @@ -5688,17 +5397,6 @@ $root.protos = (function() { } if (message.stageName != null && message.hasOwnProperty("stageName")) object.stageName = message.stageName; - var keys2; - if (message.strToVec2DListMap && (keys2 = Object.keys(message.strToVec2DListMap)).length) { - object.strToVec2DListMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.strToVec2DListMap[keys2[j]] = $root.sharedprotos.Vec2DList.toObject(message.strToVec2DListMap[keys2[j]], options); - } - if (message.strToPolygon2DListMap && (keys2 = Object.keys(message.strToPolygon2DListMap)).length) { - object.strToPolygon2DListMap = {}; - for (var j = 0; j < keys2.length; ++j) - object.strToPolygon2DListMap[keys2[j]] = $root.sharedprotos.Polygon2DList.toObject(message.strToPolygon2DListMap[keys2[j]], options); - } if (message.stageDiscreteW != null && message.hasOwnProperty("stageDiscreteW")) object.stageDiscreteW = message.stageDiscreteW; if (message.stageDiscreteH != null && message.hasOwnProperty("stageDiscreteH")) @@ -5749,6 +5447,7 @@ $root.protos = (function() { object.spAtkLookupFrames = message.spAtkLookupFrames; if (message.renderCacheSize != null && message.hasOwnProperty("renderCacheSize")) object.renderCacheSize = message.renderCacheSize; + var keys2; if (message.meleeSkillConfig && (keys2 = Object.keys(message.meleeSkillConfig)).length) { object.meleeSkillConfig = {}; for (var j = 0; j < keys2.length; ++j) diff --git a/jsexport/battle/battle.go b/jsexport/battle/battle.go index 7305955..887b3fb 100644 --- a/jsexport/battle/battle.go +++ b/jsexport/battle/battle.go @@ -43,7 +43,7 @@ func ConvertToInputFrameId(renderFrameId int32, inputDelayFrames int32, inputSca return ((renderFrameId - inputDelayFrames) >> inputScaleFrames) } -func DecodeInput(encodedInput uint64) *InputFrameDecoded { +func decodeInput(encodedInput uint64) *InputFrameDecoded { encodedDirection := (encodedInput & uint64(15)) btnALevel := int32((encodedInput >> 4) & 1) btnBLevel := int32((encodedInput >> 5) & 1) @@ -255,7 +255,7 @@ func VirtualGridToPolygonColliderBLPos(vx, vy int32, halfBoundingW, halfBounding return WorldToPolygonColliderBLPos(wx, wy, halfBoundingW, halfBoundingH, topPadding, bottomPadding, leftPadding, rightPadding, collisionSpaceOffsetX, collisionSpaceOffsetY) } -func CalcHardPushbacksNorms(playerCollider *resolv.Object, playerShape *resolv.ConvexPolygon, snapIntoPlatformOverlap float64, pEffPushback *Vec2D) []Vec2D { +func calcHardPushbacksNorms(playerCollider *resolv.Object, playerShape *resolv.ConvexPolygon, snapIntoPlatformOverlap float64, pEffPushback *Vec2D) []Vec2D { ret := make([]Vec2D, 0, 10) // no one would simultaneously have more than 5 hardPushbacks collision := playerCollider.Check(0, 0) if nil == collision { @@ -281,8 +281,9 @@ func CalcHardPushbacksNorms(playerCollider *resolv.Object, playerShape *resolv.C return ret } -func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputFrame, delayedInputFrameForPrevRenderFrame *InputFrameDownsync, currRenderFrame *RoomDownsyncFrame, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, gravityX, gravityY, jumpingInitVelY, inputDelayFrames, inputScaleFrames int32, collisionSpaceOffsetX, collisionSpaceOffsetY, snapIntoPlatformOverlap, snapIntoPlatformThreshold, worldToVirtualGridRatio, virtualGridToWorldRatio float64) *RoomDownsyncFrame { - // [WARNING] This function MUST BE called while "InputsBufferLock" is locked! +// [WARNING] The params of this method is carefully tuned such that only "battle.RoomDownsyncFrame" is a necessary custom struct. +func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputList, delayedInputListForPrevRenderFrame []uint64, currRenderFrame *RoomDownsyncFrame, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, gravityX, gravityY, jumpingInitVelY, inputDelayFrames, inputScaleFrames int32, collisionSpaceOffsetX, collisionSpaceOffsetY, snapIntoPlatformOverlap, snapIntoPlatformThreshold, worldToVirtualGridRatio, virtualGridToWorldRatio float64) *RoomDownsyncFrame { + // [WARNING] On backend this function MUST BE called while "InputsBufferLock" is locked! roomCapacity := len(currRenderFrame.PlayersArr) nextRenderFramePlayers := make([]*PlayerDownsync, roomCapacity) // Make a copy first @@ -315,18 +316,17 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputFrame, delay hardPushbackNorms := make([][]Vec2D, roomCapacity) // 1. Process player inputs - if nil != delayedInputFrame { - inputList := delayedInputFrame.InputList + if nil != delayedInputList { for i, currPlayerDownsync := range currRenderFrame.PlayersArr { joinIndex := currPlayerDownsync.JoinIndex thatPlayerInNextFrame := nextRenderFramePlayers[i] if 0 < thatPlayerInNextFrame.FramesToRecover { continue } - decodedInput := DecodeInput(inputList[joinIndex-1]) + decodedInput := decodeInput(delayedInputList[joinIndex-1]) prevBtnBLevel := int32(0) - if nil != delayedInputFrameForPrevRenderFrame { - prevDecodedInput := DecodeInput(delayedInputFrameForPrevRenderFrame.InputList[joinIndex-1]) + if nil != delayedInputListForPrevRenderFrame { + prevDecodedInput := decodeInput(delayedInputListForPrevRenderFrame[joinIndex-1]) prevBtnBLevel = prevDecodedInput.BtnBLevel } @@ -386,7 +386,7 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputFrame, delay collisionPlayerIndex := COLLISION_PLAYER_INDEX_PREFIX + joinIndex playerCollider := collisionSysMap[collisionPlayerIndex] playerShape := playerCollider.Shape.(*resolv.ConvexPolygon) - hardPushbackNorms[joinIndex-1] = CalcHardPushbacksNorms(playerCollider, playerShape, snapIntoPlatformOverlap, &(effPushbacks[joinIndex-1])) + hardPushbackNorms[joinIndex-1] = calcHardPushbacksNorms(playerCollider, playerShape, snapIntoPlatformOverlap, &(effPushbacks[joinIndex-1])) thatPlayerInNextFrame := nextRenderFramePlayers[i] fallStopping := false if collision := playerCollider.Check(0, 0); nil != collision { @@ -394,12 +394,13 @@ func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputFrame, delay isBarrier, isAnotherPlayer, isBullet := false, false, false // TODO: Make this part work in JavaScript without having to expose all types Barrier/PlayerDownsync/MeleeBullet by js.MakeWrapper. switch obj.Data.(type) { - case *Barrier: - isBarrier = true case *PlayerDownsync: isAnotherPlayer = true case *MeleeBullet: isBullet = true + default: + // By default it's a regular barrier, even if data is nil + isBarrier = true } if isBullet { // ignore bullets for this step diff --git a/jsexport/battle/room_downsync_frame.go b/jsexport/battle/room_downsync_frame.go index d0ebcae..aa56cbc 100644 --- a/jsexport/battle/room_downsync_frame.go +++ b/jsexport/battle/room_downsync_frame.go @@ -47,12 +47,6 @@ type InputFrameUpsync struct { Encoded uint64 } -type InputFrameDownsync struct { - InputFrameId int32 - InputList []uint64 - ConfirmedList uint64 -} - type Barrier struct { Boundary *Polygon2D } diff --git a/jsexport/main.go b/jsexport/main.go index 2a0b152..0128766 100644 --- a/jsexport/main.go +++ b/jsexport/main.go @@ -58,14 +58,6 @@ func NewRoomDownsyncFrameJs(id int32, playersArr []*PlayerDownsync, meleeBullets }) } -func NewInputFrameDownsyncJs(inputFrameId int32, inputList []uint64, confirmedList uint64) *js.Object { - return js.MakeFullWrapper(&InputFrameDownsync{ - InputFrameId: inputFrameId, - InputList: inputList, - ConfirmedList: confirmedList, - }) -} - func GetCollisionSpaceObjsJs(space *resolv.Space) []*js.Object { objs := space.Objects() ret := make([]*js.Object, 0, len(objs)) @@ -110,9 +102,9 @@ func CheckCollisionJs(obj *resolv.Object, dx, dy float64) *js.Object { return js.MakeFullWrapper(obj.Check(dx, dy)) } -func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(delayedInputFrame, delayedInputFrameForPrevRenderFrame *InputFrameDownsync, currRenderFrame *RoomDownsyncFrame, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, gravityX, gravityY, jumpingInitVelY, inputDelayFrames, inputScaleFrames int32, collisionSpaceOffsetX, collisionSpaceOffsetY, snapIntoPlatformOverlap, snapIntoPlatformThreshold, worldToVirtualGridRatio, virtualGridToWorldRatio float64) *js.Object { +func ApplyInputFrameDownsyncDynamicsOnSingleRenderFrameJs(delayedInputList, delayedInputListForPrevRenderFrame []uint64, currRenderFrame *RoomDownsyncFrame, collisionSys *resolv.Space, collisionSysMap map[int32]*resolv.Object, gravityX, gravityY, jumpingInitVelY, inputDelayFrames, inputScaleFrames int32, collisionSpaceOffsetX, collisionSpaceOffsetY, snapIntoPlatformOverlap, snapIntoPlatformThreshold, worldToVirtualGridRatio, virtualGridToWorldRatio float64) *js.Object { // We need access to all fields of RoomDownsyncFrame for displaying in frontend - return js.MakeFullWrapper(ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputFrame, delayedInputFrameForPrevRenderFrame, currRenderFrame, collisionSys, collisionSysMap, gravityX, gravityY, jumpingInitVelY, inputDelayFrames, inputScaleFrames, collisionSpaceOffsetX, collisionSpaceOffsetY, snapIntoPlatformOverlap, snapIntoPlatformThreshold, worldToVirtualGridRatio, virtualGridToWorldRatio)) + return js.MakeFullWrapper(ApplyInputFrameDownsyncDynamicsOnSingleRenderFrame(delayedInputList, delayedInputListForPrevRenderFrame, currRenderFrame, collisionSys, collisionSysMap, gravityX, gravityY, jumpingInitVelY, inputDelayFrames, inputScaleFrames, collisionSpaceOffsetX, collisionSpaceOffsetY, snapIntoPlatformOverlap, snapIntoPlatformThreshold, worldToVirtualGridRatio, virtualGridToWorldRatio)) } func main() { @@ -123,7 +115,6 @@ func main() { "NewPlayerDownsyncJs": NewPlayerDownsyncJs, "NewRoomDownsyncFrameJs": NewRoomDownsyncFrameJs, "NewCollisionSpaceJs": NewCollisionSpaceJs, - "NewInputFrameDownsyncJs": NewInputFrameDownsyncJs, "GenerateRectColliderJs": GenerateRectColliderJs, "GenerateConvexPolygonColliderJs": GenerateConvexPolygonColliderJs, "GetPlayersArrJs": GetPlayersArrJs, diff --git a/proto_gen_shortcut.sh b/proto_gen_shortcut.sh index 505cf68..dbceeb1 100755 --- a/proto_gen_shortcut.sh +++ b/proto_gen_shortcut.sh @@ -6,7 +6,7 @@ golang_basedir_1=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/dnmshared protoc -I=$golang_basedir_1/../frontend/assets/resources/pbfiles/ --go_out=. geometry.proto -echo "GOLANG part 1 done" +echo "GOLANG part 1 done" # [WARNING] The output of "part 1" is DEPRECATED, the codes are not using it anymore. # [WARNING] The following "room_downsync_frame.proto" is generated in another Go package than "geometry.proto", but the generated Go codes are also required to work with imports correctly! golang_basedir_2=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/battle_srv