{
  "code": "import { GameTool } from \"../Util/GameTool\";\r\nimport { NetInfoManager } from \"./NetInfoManager\";\r\nimport { PlayerManager } from \"./PlayerManager\";\r\nvar Sprite = Laya.Sprite;\r\nvar Handler = Laya.Handler;\r\nexport class LevelController {\r\n    static get Instance() {\r\n        return LevelController.instance || (LevelController.instance = new LevelController());\r\n    }\r\n    showApe() {\r\n        var ape = new Sprite();\r\n        Laya.stage.addChild(ape);\r\n        ape.loadImage(\"res/apes/monkey3.png\");\r\n        Laya.loader.load(\"res/apes/monkey2.png\", Handler.create(this, function () {\r\n            var t = Laya.loader.getRes(\"res/apes/monkey2.png\");\r\n            var ape = new Sprite();\r\n            ape.graphics.drawTexture(t, 0, 0);\r\n            Laya.stage.addChild(ape);\r\n            ape.pos(200, 0);\r\n        }));\r\n    }\r\n    SetLevel(level) {\r\n        let len = NetInfoManager.Instance._level.length;\r\n        let index = PlayerManager.Instance.stage;\r\n        if (PlayerManager.Instance.stage > len)\r\n            index = GameTool.randomInt(1, len);\r\n        this.curLevelData = NetInfoManager.Instance.GetLevel(index);\r\n        if (!this._level)\r\n            this._level = new Level();\r\n        this._level.SetLevel(this.curLevelData);\r\n    }\r\n}\r\nexport class Level {\r\n    constructor() {\r\n        this.road_list = [];\r\n        this.fail_gold = 0;\r\n    }\r\n    createApes() {\r\n        var layoutRadius = 150;\r\n        var radianUnit = Math.PI / 2;\r\n        this.apesCtn = new Sprite();\r\n        Laya.stage.addChild(this.apesCtn);\r\n        for (var i = 0; i < 4; i++) {\r\n            var ape = new Sprite();\r\n            ape.loadImage(\"res/apes/monkey\" + i + \".png\");\r\n            ape.pivot(55, 72);\r\n            ape.pos(Math.cos(radianUnit * i) * layoutRadius, Math.sin(radianUnit * i) * layoutRadius);\r\n            this.apesCtn.addChild(ape);\r\n        }\r\n        this.apesCtn.pos(Laya.stage.width / 2, Laya.stage.height / 2);\r\n    }\r\n    SetLevel(data) {\r\n        this.road_list = GameTool.SpliteString(data[\"road_list\"]);\r\n        this.gold = Number(data[\"gold\"]);\r\n        this.fail_gold = Number(data[\"fail_gold\"]);\r\n        this.enemy = data[\"enemy\"];\r\n        this.enemy_hp = data[\"enemy_hp\"];\r\n        this.isgold = Number(data[\"isgold\"]) == 1;\r\n        this.enemy_cloth = data[\"enemy_cloth\"] ? Number(data[\"enemy_cloth\"]) : 1;\r\n    }\r\n}\r\n//# sourceMappingURL=LevelController.js.map",
  "references": [
    "C:/Users/Administrator/Desktop/gungang/src/Net/GlobalParam.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Util/GameTool.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/NetInfoManager.ts",
    "C:/Users/Administrator/Desktop/gungang/src/Game/PlayerManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"LevelController.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Game/LevelController.ts\"],\"names\":[],\"mappings\":\"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,IAAO,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAI3B,IAAO,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;AAG/B,MAAM,OAAO,eAAe;IAEjB,MAAM,KAAK,QAAQ;QACtB,OAAO,eAAe,CAAC,QAAQ,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC,CAAC;IAC1F,CAAC;IAKO,OAAO;QAEX,IAAI,GAAG,GAAW,IAAI,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzB,GAAG,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAC;QAGtC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;YA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