{
  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nimport { GameUtils } from \"../GameUtils/GameUtils\";\r\nimport { GameManager, GameState } from \"../Scripts/Game/GameManager\";\r\nimport { NetworkManager, PROTOCOLS } from \"../Scripts/Network/NetworkManager\";\r\nimport { PlayerAccount } from \"../Scripts/Network/PlayerAccount\";\r\nimport WxApi from \"../WXSDK/wxsdk\";\r\nimport { LevelManager } from \"../Scripts/Game/LevelManager\";\r\nexport class QueueWindow extends ui.Window.QueueWindowUI {\r\n    constructor() {\r\n        super();\r\n        this.queueAtlas = [\r\n            \"res/atlas/local.atlas\",\r\n            \"res/atlas/local.png\",\r\n            \"res/atlas/load.atlas\",\r\n            \"res/atlas/load.png\",\r\n        ];\r\n        this.indess = [];\r\n        QueueWindow.instance = this;\r\n    }\r\n    static get Instance() {\r\n        return QueueWindow.instance;\r\n    }\r\n    OnOpen(_data = null) {\r\n        WxApi.Instance.recordAldEvent(\"进入排队界面\", \"1\");\r\n        var agrs = [{ \"t\": PlayerAccount.CurrentAccount.ServerTime.toString() }, { \"n\": \"5\" }];\r\n        NetworkManager.Instance.HttpPostRequest(PROTOCOLS.game, agrs, Laya.Handler.create(this, this.OnStarcomplete), null);\r\n        this.height = Laya.stage.height;\r\n    }\r\n    OnResLoad() {\r\n        Laya.timer.once(1000, this, this.OnQueueEnd);\r\n        for (var i = 1; i < 30; i++) {\r\n            this.indess.push(i);\r\n        }\r\n        for (var i = 0; i < this.quelist.numChildren; i++) {\r\n            var cursprite = this.quelist.getChildAt(i);\r\n            this.ShowIcon(cursprite);\r\n        }\r\n    }\r\n    OnStarcomplete(e) {\r\n        this.OnResLoad();\r\n    }\r\n    ShowIcon(_sprite) {\r\n        var time = GameUtils.getRandomInt(0, 900);\r\n        Laya.timer.once(time, this, () => {\r\n            var index = GameUtils.getRandomInt(0, this.indess.length);\r\n            var num = this.indess[index];\r\n            this.indess.splice(index, 1);\r\n            _sprite.skin = \"icon/\" + num + \".png\";\r\n        }, null, false);\r\n    }\r\n    OnQueueEnd() {\r\n        WxApi.Instance.recordAldEvent(\"排队结束开始游戏\", \"1\");\r\n        var stage = LevelManager.Instance.curLevel;\r\n        WxApi.Instance.levelStart(stage.levelid.toString(), stage.levelid.toString(), PlayerAccount.CurrentAccount.CurAccountData.UseId);\r\n        GameManager.Instance.ChangeState(GameState.Playing);\r\n    }\r\n    OnHide() {\r\n    }\r\n}\r\n",
  "references": [
    "C:/Users/admin/Desktop/runner/src/Window/Component/IWindow.ts",
    "C:/Users/admin/Desktop/runner/src/ui/layaMaxUI.ts",
    "C:/Users/admin/Desktop/runner/src/GameUtils/GameUtils.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/GameManager.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Network/NetworkManager.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Network/PlayerAccount.ts",
    "C:/Users/admin/Desktop/runner/src/WXSDK/wxsdk.ts",
    "C:/Users/admin/Desktop/runner/src/Main.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/LevelManager.ts"
  ]
}
