From b0511db001604691e17f43201730af8c0ff1b2ee Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Thu, 13 Aug 2020 17:39:24 +0800 Subject: [PATCH] =?UTF-8?q?#28=20tiled=20=E6=95=B0=E6=8D=AE=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E4=B8=8E=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/libs/framework/framework.d.ts | 108 ++- demo/libs/framework/framework.js | 828 ++++++++++++++---- demo/libs/framework/framework.min.js | 2 +- .../assets/isometric_grass_and_water.json | 345 ++++++++ .../assets/isometric_grass_and_water.png | Bin 0 -> 104828 bytes demo/resource/default.res.json | 2 +- demo/src/game/MainScene.ts | 4 + source/bin/framework.d.ts | 108 ++- source/bin/framework.js | 828 ++++++++++++++---- source/bin/framework.min.js | 2 +- source/src/ECS/Components/TiledMapRenderer.ts | 51 +- source/src/ECS/Core.ts | 4 + source/src/Tiled/Group.ts | 10 +- source/src/Tiled/Map.ts | 20 +- source/src/Tiled/ObjectGroup.ts | 9 +- source/src/Tiled/TiledCore.ts | 69 +- source/src/Tiled/TiledMapLoader.ts | 406 +++++++++ source/src/Tiled/TiledRendering.ts | 113 ++- source/src/Tiled/Tileset.ts | 2 +- source/src/Tiled/TilesetTile.ts | 2 +- source/src/Tiled/TmxUtils.ts | 50 ++ source/src/Utils/Base64Utils.ts | 238 ++--- source/src/Utils/DrawUtils.ts | 23 + 23 files changed, 2586 insertions(+), 638 deletions(-) create mode 100644 demo/resource/assets/isometric_grass_and_water.json create mode 100644 demo/resource/assets/isometric_grass_and_water.png create mode 100644 source/src/Tiled/TiledMapLoader.ts create mode 100644 source/src/Tiled/TmxUtils.ts diff --git a/demo/libs/framework/framework.d.ts b/demo/libs/framework/framework.d.ts index c98637a7..e5fa93f1 100644 --- a/demo/libs/framework/framework.d.ts +++ b/demo/libs/framework/framework.d.ts @@ -252,6 +252,7 @@ declare module es { declare module es { class Core extends egret.DisplayObjectContainer { static emitter: Emitter; + static debugRenderEndabled: boolean; static graphicsDevice: GraphicsDevice; static content: ContentManager; static _instance: Core; @@ -1551,11 +1552,11 @@ declare module es { properties: Map; visible: boolean; name: string; - layers: TmxList; - tileLayers: TmxList; - objectGroups: TmxList; - imageLayers: TmxList; - groups: TmxList; + layers: ITmxLayer[]; + tileLayers: TmxLayer[]; + objectGroups: TmxObjectGroup[]; + imageLayers: TmxImageLayer[]; + groups: TmxGroup[]; } } declare module es { @@ -1618,19 +1619,15 @@ declare module es { } declare module es { class TmxDocument { - TmxDirectory: string; + tmxDirectory: string; constructor(); } interface ITmxElement { name: string; } - class TmxList extends Map { - _nameCount: Map; - add(t: T): void; - protected getKeyForItem(item: T): string; - } class TmxImage { - texture: egret.Texture; + bitmap: egret.Bitmap; + readonly texture: egret.Texture; source: string; format: string; data: any; @@ -1657,12 +1654,12 @@ declare module es { renderOrder: RenderOrderType; backgroundColor: number; nextObjectID?: number; - layers: TmxList; - tilesets: TmxList; - tileLayers: TmxList; - objectGroups: TmxList; - imageLayers: TmxList; - groups: TmxList; + layers: ITmxLayer[]; + tilesets: TmxTileset[]; + tileLayers: TmxLayer[]; + objectGroups: TmxLayer[]; + imageLayers: TmxImageLayer[]; + groups: TmxGroup[]; properties: Map; maxTileWidth: number; maxTileHeight: number; @@ -1707,12 +1704,14 @@ declare module es { offsetY: number; color: number; drawOrder: DrawOrderType; - objects: TmxList; + objects: TmxObject[]; properties: Map; } class TmxObject implements ITmxElement { id: number; name: string; + shape: egret.Shape; + textField: egret.TextField; objectType: TmxObjectType; type: string; x: number; @@ -1725,6 +1724,7 @@ declare module es { text: TmxText; points: Vector2[]; properties: Map; + constructor(); } class TmxText { fontFamily: string; @@ -1769,14 +1769,40 @@ declare module es { bottom = 2 } } +declare module es { + class TiledMapLoader { + static loadTmxMap(map: TmxMap, filePath: string): Promise; + static loadTmxMapData(map: TmxMap, xMap: any): Promise; + static parseLayers(container: any, xEle: any, map: TmxMap, width: number, height: number, tmxDirectory: string): void; + private static updateMaxTileSizes; + static parseOrientationType(type: string): OrientationType; + static parseStaggerAxisType(type: string): StaggerAxisType; + static parseStaggerIndexType(type: string): StaggerIndexType; + static parseRenderOrderType(type: string): RenderOrderType; + static parsePropertyDict(prop: any): Map; + static parseTmxTileset(map: TmxMap, xTileset: any): Promise; + static loadTmxTileset(tileset: TmxTileset, map: TmxMap, xTileset: any, firstGid: number): Promise; + static loadTmxTilesetTile(tile: TmxTilesetTile, tileset: TmxTileset, xTile: any, terrains: TmxTerrain[]): Promise; + static loadTmxAnimationFrame(frame: TmxAnimationFrame, xFrame: any): TmxAnimationFrame; + static loadTmxObjectGroup(group: TmxObjectGroup, map: TmxMap, xObjectGroup: any): TmxObjectGroup; + static loadTmxObject(obj: TmxObject, map: TmxMap, xObject: any): TmxObject; + static loadTmxText(text: TmxText, xText: any): TmxText; + static loadTmxAlignment(alignment: TmxAlignment, xText: any): TmxAlignment; + static parsePoints(xPoints: any): any[]; + static parsePoint(s: string): Vector2; + static parseTmxTerrain(xTerrain: any): TmxTerrain; + static parseTmxTileOffset(xTileOffset: any): TmxTileOffset; + static loadTmxImage(image: TmxImage, xImage: any): Promise; + } +} declare module es { class TiledRendering { - static renderMap(map: TmxMap, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderLayer(layer: TmxLayer, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderImageLayer(layer: TmxImageLayer, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderObjectGroup(objGroup: TmxObjectGroup, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderGroup(group: TmxGroup, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderTile(tile: TmxLayerTile, position: Vector2, scale: Vector2, tileWidth: number, tileHeight: number, color: Color, layerDepth: number): void; + static renderMap(map: TmxMap, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderLayer(layer: TmxLayer, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderImageLayer(layer: TmxImageLayer, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderObjectGroup(objGroup: TmxObjectGroup, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderGroup(group: TmxGroup, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderTile(tile: TmxLayerTile, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, tileWidth: number, tileHeight: number, color: egret.ColorMatrixFilter, layerDepth: number): void; } } declare module es { @@ -1794,7 +1820,7 @@ declare module es { tileOffset: TmxTileOffset; properties: Map; image: TmxImage; - terrains: TmxList; + terrains: TmxTerrain[]; tileRegions: Map; update(): void; } @@ -1817,7 +1843,7 @@ declare module es { type: string; properties: Map; image: TmxImage; - objectGroups: TmxList; + objectGroups: TmxObjectGroup[]; animationFrames: TmxAnimationFrame[]; readonly currentAnimationFrameGid: number; _animationElapsedTime: number; @@ -1835,6 +1861,12 @@ declare module es { duration: number; } } +declare module es { + class TmxUtils { + static decode(data: any, encoding: any, compression: string): Array; + static color16ToUnit($color: string): number; + } +} declare class ArrayUtils { static bubbleSort(ary: number[]): void; static insertionSort(ary: number[]): void; @@ -1850,15 +1882,16 @@ declare class ArrayUtils { static equals(ary1: number[], ary2: number[]): Boolean; static insert(ary: any[], index: number, value: any): any; } -declare class Base64Utils { - private static _keyNum; - private static _keyStr; - private static _keyAll; - static encode: (input: any) => string; - static decode(input: any, isNotStr?: boolean): string; - private static _utf8_encode; - private static _utf8_decode; - private static getConfKey; +declare module es { + class Base64Utils { + private static _keyStr; + static readonly nativeBase64: boolean; + static decode(input: string): string; + static encode(input: string): string; + static decodeBase64AsArray(input: string, bytes: number): Uint32Array; + static decompress(data: string, decoded: any, compression: string): any; + static decodeCSV(input: string): Array; + } } declare module es { class Color { @@ -1882,6 +1915,9 @@ declare module es { declare module es { class DrawUtils { static drawLine(shape: egret.Shape, start: Vector2, end: Vector2, color: number, thickness?: number): void; + static drawCircle(shape: egret.Shape, position: Vector2, radius: number, color: number): void; + static drawPoints(shape: egret.Shape, position: Vector2, points: Vector2[], color: number, closePoly?: boolean, thickness?: number): void; + static drawString(textField: egret.TextField, text: string, position: Vector2, color: number, rotation: number, origin: Vector2, scale: number): void; static drawLineAngle(shape: egret.Shape, start: Vector2, radians: number, length: number, color: number, thickness?: number): void; static drawHollowRect(shape: egret.Shape, rect: Rectangle, color: number, thickness?: number): void; static drawHollowRectR(shape: egret.Shape, x: number, y: number, width: number, height: number, color: number, thickness?: number): void; diff --git a/demo/libs/framework/framework.js b/demo/libs/framework/framework.js index ff49d9b2..4aa21528 100644 --- a/demo/libs/framework/framework.js +++ b/demo/libs/framework/framework.js @@ -1284,6 +1284,7 @@ var es; es.Input.initialize(); this.initialize(); }; + Core.debugRenderEndabled = false; return Core; }(egret.DisplayObjectContainer)); es.Core = Core; @@ -3296,8 +3297,9 @@ var es; _this.physicsLayer = 1 << 0; _this.tiledMap = tiledMap; _this._shouldCreateColliders = shouldCreateColliders; + _this.displayObject = new egret.DisplayObjectContainer(); if (collisionLayerName) { - _this.collisionLayer = tiledMap.tileLayers.get(collisionLayerName); + _this.collisionLayer = tiledMap.tileLayers[collisionLayerName]; } return _this; } @@ -3333,7 +3335,7 @@ var es; var layerType = this.tiledMap.getLayer(layerName); for (var layer in this.tiledMap.layers) { if (this.tiledMap.layers.hasOwnProperty(layer) && - this.tiledMap.layers.get(layer) == layerType) { + this.tiledMap.layers[layer] == layerType) { return index; } } @@ -3364,12 +3366,12 @@ var es; }; TiledMapRenderer.prototype.render = function (camera) { if (!this.layerIndicesToRender) { - es.TiledRendering.renderMap(this.tiledMap, es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); + es.TiledRendering.renderMap(this.tiledMap, this.displayObject, es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); } else { - for (var i = 0; i < this.tiledMap.layers.size; i++) { - if (this.tiledMap.layers.get(i.toString()).visible && this.layerIndicesToRender.contains(i)) - es.TiledRendering.renderLayer(this.tiledMap.layers.get(i.toString()), es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); + for (var i = 0; i < this.tiledMap.layers.length; i++) { + if (this.tiledMap.layers[i].visible && this.layerIndicesToRender.contains(i)) + es.TiledRendering.renderLayer(this.tiledMap.layers[i], this.displayObject, es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); } } }; @@ -7606,45 +7608,25 @@ var es; (function (es) { var TmxDocument = (function () { function TmxDocument() { - this.TmxDirectory = ""; + this.tmxDirectory = ""; } return TmxDocument; }()); es.TmxDocument = TmxDocument; - var TmxList = (function (_super) { - __extends(TmxList, _super); - function TmxList() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._nameCount = new Map(); - return _this; - } - TmxList.prototype.add = function (t) { - var tName = t.name; - if (this.has(tName)) - this._nameCount.set(tName, this._nameCount.get(tName) + 1); - else - this._nameCount.set(tName, 0); - }; - TmxList.prototype.getKeyForItem = function (item) { - var name = item.name; - var count = this._nameCount.get(name); - var dupes = 0; - while (this.has(name)) { - name = name + es.Enumerable.repeat("_", dupes).toString() + count.toString(); - dupes++; - } - return name; - }; - return TmxList; - }(Map)); - es.TmxList = TmxList; var TmxImage = (function () { function TmxImage() { } + Object.defineProperty(TmxImage.prototype, "texture", { + get: function () { + return this.bitmap.texture; + }, + enumerable: true, + configurable: true + }); TmxImage.prototype.dispose = function () { - if (this.texture) { + if (this.bitmap) { this.texture.dispose(); - this.texture = null; + this.bitmap = null; } }; return TmxImage; @@ -7682,9 +7664,9 @@ var es; TmxMap.prototype.getTilesetForTileGid = function (gid) { if (gid == 0) return null; - for (var i = this.tilesets.size - 1; i >= 0; i--) { - if (this.tilesets.get(i.toString()).firstGid <= gid) - return this.tilesets.get(i.toString()); + for (var i = this.tilesets.length - 1; i >= 0; i--) { + if (this.tilesets[i].firstGid <= gid) + return this.tilesets[i]; } console.error("tile gid" + gid + "\u672A\u5728\u4EFB\u4F55tileset\u4E2D\u627E\u5230"); }; @@ -7703,7 +7685,7 @@ var es; return es.MathHelper.clamp(tileY, 0, this.height - 1); }; TmxMap.prototype.getLayer = function (name) { - return this.layers.get(name); + return this.layers[name]; }; TmxMap.prototype.update = function () { this.tilesets.forEach(function (tileset) { tileset.update(); }); @@ -7759,6 +7741,8 @@ var es; es.TmxObjectGroup = TmxObjectGroup; var TmxObject = (function () { function TmxObject() { + this.shape = new egret.Shape(); + this.textField = new egret.TextField(); } return TmxObject; }()); @@ -7806,103 +7790,562 @@ var es; })(TmxVerticalAlignment = es.TmxVerticalAlignment || (es.TmxVerticalAlignment = {})); })(es || (es = {})); var es; +(function (es) { + var Bitmap = egret.Bitmap; + var TiledMapLoader = (function () { + function TiledMapLoader() { + } + TiledMapLoader.loadTmxMap = function (map, filePath) { + var xMap = RES.getRes(filePath); + return this.loadTmxMapData(map, xMap); + }; + TiledMapLoader.loadTmxMapData = function (map, xMap) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, e, tileset; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + map.version = xMap["version"]; + map.tiledVersion = xMap["tiledversion"]; + map.width = xMap["width"]; + map.height = xMap["height"]; + map.tileWidth = xMap["tilewidth"]; + map.tileHeight = xMap["tileheight"]; + map.hexSideLength = xMap["hexsidelength"]; + map.orientation = this.parseOrientationType(xMap["orientation"]); + map.staggerAxis = this.parseStaggerAxisType(xMap["staggeraxis"]); + map.staggerIndex = this.parseStaggerIndexType(xMap["staggerindex"]); + map.renderOrder = this.parseRenderOrderType(xMap["renderorder"]); + map.nextObjectID = xMap["nextobjectid"]; + map.backgroundColor = es.TmxUtils.color16ToUnit(xMap["color"]); + map.properties = this.parsePropertyDict(xMap["properties"]); + map.maxTileWidth = map.tileWidth; + map.maxTileHeight = map.tileHeight; + map.tilesets = []; + _i = 0, _a = xMap["tilesets"]; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + e = _a[_i]; + return [4, this.parseTmxTileset(map, e)]; + case 2: + tileset = _b.sent(); + map.tilesets.push(tileset); + this.updateMaxTileSizes(tileset); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: + map.layers = []; + map.tileLayers = []; + map.objectGroups = []; + map.imageLayers = []; + map.groups = []; + this.parseLayers(map, xMap, map, map.width, map.height, map.tmxDirectory); + return [2, map]; + } + }); + }); + }; + TiledMapLoader.parseLayers = function (container, xEle, map, width, height, tmxDirectory) { + }; + TiledMapLoader.updateMaxTileSizes = function (tileset) { + tileset.tiles.forEach(function (tile) { + if (tile.image) { + if (tile.image.width > tileset.map.maxTileWidth) + tileset.map.maxTileWidth = tile.image.width; + if (tile.image.height > tileset.map.maxTileHeight) + tileset.map.maxTileHeight = tile.image.height; + } + }); + tileset.tileRegions.forEach(function (region) { + var width = region.width; + var height = region.height; + if (width > tileset.map.maxTileWidth) + tileset.map.maxTileWidth = width; + if (width > tileset.map.maxTileHeight) + tileset.map.maxTileHeight = height; + }); + }; + TiledMapLoader.parseOrientationType = function (type) { + if (type == "unknown") + return es.OrientationType.unknown; + if (type == "orthogonal") + return es.OrientationType.orthogonal; + if (type == "isometric") + return es.OrientationType.isometric; + if (type == "staggered") + return es.OrientationType.staggered; + if (type == "hexagonal") + return es.OrientationType.hexagonal; + return es.OrientationType.unknown; + }; + TiledMapLoader.parseStaggerAxisType = function (type) { + if (type == "y") + return es.StaggerAxisType.y; + return es.StaggerAxisType.x; + }; + TiledMapLoader.parseStaggerIndexType = function (type) { + if (type == "even") + return es.StaggerIndexType.even; + return es.StaggerIndexType.odd; + }; + TiledMapLoader.parseRenderOrderType = function (type) { + if (type == "right-up") + return es.RenderOrderType.rightUp; + if (type == "left-down") + return es.RenderOrderType.leftDown; + if (type == "left-up") + return es.RenderOrderType.leftUp; + return es.RenderOrderType.rightDown; + }; + TiledMapLoader.parsePropertyDict = function (prop) { + if (!prop) + return null; + var dict = new Map(); + for (var _i = 0, _a = prop["property"]; _i < _a.length; _i++) { + var p = _a[_i]; + var pname = p["name"]; + var valueAttr = p["value"]; + var pval = valueAttr ? valueAttr : p; + dict.set(pname, pval); + } + return dict; + }; + TiledMapLoader.parseTmxTileset = function (map, xTileset) { + return __awaiter(this, void 0, void 0, function () { + var xFirstGid, firstGid, source, xDocTileset, tileset; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + xFirstGid = xTileset["firstgid"]; + firstGid = xFirstGid; + source = xTileset["image"]; + if (!!source) return [3, 2]; + source = "resource/assets/" + source; + return [4, RES.getResByUrl(source, null, this, RES.ResourceItem.TYPE_IMAGE)]; + case 1: + xDocTileset = _a.sent(); + tileset = this.loadTmxTileset(new es.TmxTileset(), map, xDocTileset["tileset"], firstGid); + return [2, tileset]; + case 2: return [2, this.loadTmxTileset(new es.TmxTileset(), map, xTileset, firstGid)]; + } + }); + }); + }; + TiledMapLoader.loadTmxTileset = function (tileset, map, xTileset, firstGid) { + return __awaiter(this, void 0, void 0, function () { + var xImage, _a, xTerrainType, _i, _b, e, _c, _d, xTile, tile, id, y, column, x; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + tileset.map = map; + tileset.firstGid = firstGid; + tileset.name = xTileset["name"]; + tileset.tileWidth = xTileset["tilewidth"]; + tileset.tileHeight = xTileset["tileheight"]; + tileset.spacing = xTileset["spacing"] != undefined ? xTileset["spacing"] : 0; + tileset.margin = xTileset["margin"] != undefined ? xTileset["margin"] : 0; + tileset.columns = xTileset["columns"]; + tileset.tileCount = xTileset["tilecount"]; + tileset.tileOffset = this.parseTmxTileOffset(xTileset["tileoffset"]); + xImage = xTileset["image"]; + if (!xImage) return [3, 2]; + _a = tileset; + return [4, this.loadTmxImage(new es.TmxImage(), xTileset)]; + case 1: + _a.image = _e.sent(); + _e.label = 2; + case 2: + xTerrainType = xTileset["terraintypes"]; + if (xTerrainType) { + tileset.terrains = []; + for (_i = 0, _b = xTerrainType["terrains"]; _i < _b.length; _i++) { + e = _b[_i]; + tileset.terrains.push(this.parseTmxTerrain(e)); + } + } + tileset.tiles = new Map(); + _c = 0, _d = xTileset["tiles"]; + _e.label = 3; + case 3: + if (!(_c < _d.length)) return [3, 6]; + xTile = _d[_c]; + return [4, this.loadTmxTilesetTile(new es.TmxTilesetTile(), tileset, xTile, tileset.terrains)]; + case 4: + tile = _e.sent(); + tileset.tiles[tile.id] = tile; + _e.label = 5; + case 5: + _c++; + return [3, 3]; + case 6: + tileset.properties = this.parsePropertyDict(xTileset["properties"]); + tileset.tileRegions = new Map(); + if (tileset.image) { + id = firstGid; + for (y = tileset.margin; y < tileset.image.height - tileset.margin; y += tileset.tileHeight + tileset.spacing) { + column = 0; + for (x = tileset.margin; x < tileset.image.width - tileset.margin; x += tileset.tileWidth + tileset.spacing) { + tileset.tileRegions.set(id++, new es.Rectangle(x, y, tileset.tileWidth, tileset.tileHeight)); + if (++column >= tileset.columns) + break; + } + } + } + else { + tileset.tiles.forEach(function (tile) { + tileset.tileRegions.set(firstGid + tile.id, new es.Rectangle(0, 0, tile.image.width, tile.image.height)); + }); + } + return [2, tileset]; + } + }); + }); + }; + TiledMapLoader.loadTmxTilesetTile = function (tile, tileset, xTile, terrains) { + return __awaiter(this, void 0, void 0, function () { + var xImage, _a, _i, _b, e, _c, _d, e; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + tile.tileset = tileset; + tile.id = xTile["id"]; + tile.terrainEdges = xTile["terrain"]; + tile.probability = xTile["probability"] != undefined ? xTile["probability"] : 1; + tile.type = xTile["type"]; + xImage = xTile["image"]; + if (!xImage) return [3, 2]; + _a = tile; + return [4, this.loadTmxImage(new es.TmxImage(), xImage)]; + case 1: + _a.image = _e.sent(); + _e.label = 2; + case 2: + tile.objectGroups = []; + if (xTile["objectgroup"]) + for (_i = 0, _b = xTile["objectgroup"]; _i < _b.length; _i++) { + e = _b[_i]; + tile.objectGroups.push(this.loadTmxObjectGroup(new es.TmxObjectGroup(), tileset.map, e)); + } + tile.animationFrames = []; + if (xTile["animation"]) { + for (_c = 0, _d = xTile["animation"]["frame"]; _c < _d.length; _c++) { + e = _d[_c]; + tile.animationFrames.push(this.loadTmxAnimationFrame(new es.TmxAnimationFrame(), e)); + } + } + tile.properties = this.parsePropertyDict(xTile["properties"]); + if (tile.properties) + tile.processProperties(); + return [2, tile]; + } + }); + }); + }; + TiledMapLoader.loadTmxAnimationFrame = function (frame, xFrame) { + frame.gid = xFrame["tileid"]; + frame.duration = xFrame["duration"] / 1000; + return frame; + }; + TiledMapLoader.loadTmxObjectGroup = function (group, map, xObjectGroup) { + group.map = map; + group.name = xObjectGroup["name"] != undefined ? xObjectGroup["name"] : ""; + group.color = es.TmxUtils.color16ToUnit(xObjectGroup["color"]); + group.opacity = xObjectGroup["opacity"] != undefined ? xObjectGroup["opacity"] : 1; + group.visible = xObjectGroup["visible"] != undefined ? xObjectGroup["visible"] : true; + group.offsetX = xObjectGroup["offsetx"] != undefined ? xObjectGroup["offsetx"] : 0; + group.offsetY = xObjectGroup["offsety"] != undefined ? xObjectGroup["offsety"] : 0; + var drawOrderDict = new Map(); + drawOrderDict.set("unknown", es.DrawOrderType.unkownOrder); + drawOrderDict.set("topdown", es.DrawOrderType.IndexOrder); + drawOrderDict.set("index", es.DrawOrderType.TopDown); + var drawOrderValue = xObjectGroup["draworder"]; + if (drawOrderValue) + group.drawOrder = drawOrderDict[drawOrderValue]; + group.objects = []; + for (var _i = 0, _a = xObjectGroup["object"]; _i < _a.length; _i++) { + var e = _a[_i]; + group.objects.push(this.loadTmxObject(new es.TmxObject(), map, e)); + } + group.properties = this.parsePropertyDict(xObjectGroup["properties"]); + return group; + }; + TiledMapLoader.loadTmxObject = function (obj, map, xObject) { + obj.id = xObject["id"] != undefined ? xObject["id"] : 0; + obj.name = xObject["name"] != undefined ? xObject["name"] : ""; + obj.x = xObject["x"]; + obj.y = xObject["y"]; + obj.width = xObject["width"] != undefined ? xObject["width"] : 0; + obj.height = xObject["height"] != undefined ? xObject["height"] : 0; + obj.type = xObject["type"] != undefined ? xObject["type"] : ""; + obj.visible = xObject["visible"] != undefined ? xObject["visible"] : true; + obj.rotation = xObject["rotation"] != undefined ? xObject["rotation"] : 0; + var xGid = xObject["gid"]; + var xEllipse = xObject["ellipse"]; + var xPolygon = xObject["polygon"]; + var xPolyline = xObject["polyline"]; + var xText = xObject["text"]; + var xPoint = xObject["point"]; + if (xGid) { + obj.tile = new es.TmxLayerTile(map, xGid, Math.round(obj.x), Math.round(obj.y)); + obj.objectType = es.TmxObjectType.tile; + } + else if (xEllipse) { + obj.objectType = es.TmxObjectType.ellipse; + } + else if (xPolygon) { + obj.points = this.parsePoints(xPolygon); + obj.objectType = es.TmxObjectType.polygon; + } + else if (xPolyline) { + obj.points = this.parsePoints(xPolyline); + obj.objectType = es.TmxObjectType.polyline; + } + else if (xText) { + obj.text = this.loadTmxText(new es.TmxText(), xText); + obj.objectType = es.TmxObjectType.text; + } + else if (xPoint) { + obj.objectType = es.TmxObjectType.point; + } + else { + obj.objectType = es.TmxObjectType.basic; + } + obj.properties = this.parsePropertyDict(xObject["properties"]); + return obj; + }; + TiledMapLoader.loadTmxText = function (text, xText) { + text.fontFamily = xText["fontfamily"] != undefined ? xText["fontfamily"] : "sans-serif"; + text.pixelSize = xText["pixelsize"] != undefined ? xText["pixelsize"] : 16; + text.wrap = xText["wrap"] != undefined ? xText["wrap"] : false; + text.color = es.TmxUtils.color16ToUnit(xText["color"]); + text.bold = xText["bold"] ? xText["bold"] : false; + text.italic = xText["italic"] ? xText["italic"] : false; + text.underline = xText["underline"] ? xText["underline"] : false; + text.strikeout = xText["strikeout"] ? xText["strikeout"] : false; + text.kerning = xText["kerning"] ? xText["kerning"] : true; + text.alignment = this.loadTmxAlignment(new es.TmxAlignment(), xText); + text.value = xText; + return text; + }; + TiledMapLoader.loadTmxAlignment = function (alignment, xText) { + function firstLetterToUpperCase(str) { + if (!str || str == "") + return str; + return str[0].toString().toUpperCase() + str.substr(1); + } + var xHorizontal = xText["halign"] != undefined ? xText["halign"] : "left"; + alignment.horizontal = es.TmxHorizontalAlignment[firstLetterToUpperCase(xHorizontal)]; + var xVertical = xText["valign"] != undefined ? xText["valign"] : "top"; + alignment.vertical = es.TmxVerticalAlignment[firstLetterToUpperCase((xVertical))]; + return alignment; + }; + TiledMapLoader.parsePoints = function (xPoints) { + var pointString = xPoints["points"]; + var pointStringPair = pointString.split(' '); + var points = []; + var index = 0; + for (var _i = 0, pointStringPair_1 = pointStringPair; _i < pointStringPair_1.length; _i++) { + var s = pointStringPair_1[_i]; + points[index++] = this.parsePoint(s); + } + return points; + }; + TiledMapLoader.parsePoint = function (s) { + var pt = s.split(','); + var x = Number(pt[0]); + var y = Number(pt[1]); + return new es.Vector2(x, y); + }; + TiledMapLoader.parseTmxTerrain = function (xTerrain) { + var terrain = new es.TmxTerrain(); + terrain.name = xTerrain["name"]; + terrain.tile = xTerrain["tile"]; + terrain.properties = this.parsePropertyDict(xTerrain["properties"]); + return terrain; + }; + TiledMapLoader.parseTmxTileOffset = function (xTileOffset) { + var tmxTileOffset = new es.TmxTileOffset(); + if (!xTileOffset) { + tmxTileOffset.x = 0; + tmxTileOffset.y = 0; + return tmxTileOffset; + } + tmxTileOffset.x = xTileOffset["x"]; + tmxTileOffset.y = xTileOffset["y"]; + return tmxTileOffset; + }; + TiledMapLoader.loadTmxImage = function (image, xImage) { + return __awaiter(this, void 0, void 0, function () { + var xSource, _a, _b, xData; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + xSource = xImage["image"]; + if (!xSource) return [3, 2]; + image.source = "resource/assets/" + xSource; + _a = image; + _b = Bitmap.bind; + return [4, RES.getResByUrl(image.source, null, this, RES.ResourceItem.TYPE_IMAGE)]; + case 1: + _a.bitmap = new (_b.apply(Bitmap, [void 0, _c.sent()]))(); + return [3, 3]; + case 2: + image.format = xImage["format"]; + xData = xImage["data"]; + image.data = es.TmxUtils.decode(xData, xData["encoding"], xData["compression"]); + _c.label = 3; + case 3: + image.trans = es.TmxUtils.color16ToUnit(xImage["trans"]); + image.width = xImage["width"] != undefined ? xImage["width"] : 0; + image.height = xImage["height"] != undefined ? xImage["height"] : 0; + return [2, image]; + } + }); + }); + }; + return TiledMapLoader; + }()); + es.TiledMapLoader = TiledMapLoader; +})(es || (es = {})); +var es; (function (es) { var TiledRendering = (function () { function TiledRendering() { } - TiledRendering.renderMap = function (map, position, scale, layerDepth) { + TiledRendering.renderMap = function (map, container, position, scale, layerDepth) { var _this = this; map.layers.forEach(function (layer) { if (layer instanceof es.TmxLayer && layer.visible) { - _this.renderLayer(layer, position, scale, layerDepth); + _this.renderLayer(layer, container, position, scale, layerDepth); } else if (layer instanceof es.TmxImageLayer && layer.visible) { - _this.renderImageLayer(layer, position, scale, layerDepth); + _this.renderImageLayer(layer, container, position, scale, layerDepth); } else if (layer instanceof es.TmxGroup && layer.visible) { - _this.renderGroup(layer, position, scale, layerDepth); + _this.renderGroup(layer, container, position, scale, layerDepth); } else if (layer instanceof es.TmxObjectGroup && layer.visible) { - _this.renderObjectGroup(layer, position, scale, layerDepth); + _this.renderObjectGroup(layer, container, position, scale, layerDepth); } }); }; - TiledRendering.renderLayer = function (layer, position, scale, layerDepth) { + TiledRendering.renderLayer = function (layer, container, position, scale, layerDepth) { if (!layer.visible) return; var tileWidth = layer.map.tileWidth * scale.x; var tileHeight = layer.map.tileHeight * scale.y; - var color = new es.Color(0, 0, 0, layer.opacity * 255); + var color = es.DrawUtils.getColorMatrix(0x000000); for (var i = 0; i < layer.tiles.length; i++) { var tile = layer.tiles[i]; if (!tile) continue; - this.renderTile(tile, position, scale, tileWidth, tileHeight, color, layerDepth); + this.renderTile(tile, container, position, scale, tileWidth, tileHeight, color, layerDepth); } }; - TiledRendering.renderImageLayer = function (layer, position, scale, layerDepth) { + TiledRendering.renderImageLayer = function (layer, container, position, scale, layerDepth) { if (!layer.visible) return; - var color = new es.Color(0, 0, 0, layer.opacity * 255); + var color = es.DrawUtils.getColorMatrix(0x000000); var pos = es.Vector2.add(position, new es.Vector2(layer.offsetX, layer.offsetY).multiply(scale)); + if (!layer.image.bitmap.parent) + container.addChild(layer.image.bitmap); + layer.image.bitmap.x = pos.x; + layer.image.bitmap.y = pos.y; + layer.image.bitmap.scaleX = scale.x; + layer.image.bitmap.scaleY = scale.y; + layer.image.bitmap.filters = [color]; }; - TiledRendering.renderObjectGroup = function (objGroup, position, scale, layerDepth) { + TiledRendering.renderObjectGroup = function (objGroup, container, position, scale, layerDepth) { if (!objGroup.visible) return; for (var object in objGroup.objects) { - var obj = objGroup.objects.get(object); + var obj = objGroup.objects[object]; if (!obj.visible) continue; + if (!es.Core.debugRenderEndabled) { + if (obj.objectType != es.TmxObjectType.tile && obj.objectType != es.TmxObjectType.text) + continue; + } var pos = es.Vector2.add(position, new es.Vector2(obj.x, obj.y).multiply(scale)); switch (obj.objectType) { case es.TmxObjectType.basic: + if (!obj.shape.parent) + container.addChild(obj.shape); + var rect = new es.Rectangle(pos.x, pos.y, obj.width * scale.x, obj.height * scale.y); + es.DrawUtils.drawHollowRect(obj.shape, rect, objGroup.color); break; case es.TmxObjectType.point: var size = objGroup.map.tileWidth * 0.5; pos.x -= size * 0.5; pos.y -= size * 0.5; + if (!obj.shape.parent) + container.addChild(obj.shape); + es.DrawUtils.drawPixel(obj.shape, pos, objGroup.color, size); break; case es.TmxObjectType.tile: var tileset = objGroup.map.getTilesetForTileGid(obj.tile.gid); var sourceRect = tileset.tileRegions[obj.tile.gid]; pos.y -= obj.tile.tilesetTile.image.height; + if (!obj.tile.tilesetTile.image.bitmap) + container.addChild(obj.tile.tilesetTile.image.bitmap); + obj.tile.tilesetTile.image.bitmap.x = pos.x; + obj.tile.tilesetTile.image.bitmap.y = pos.y; + obj.tile.tilesetTile.image.bitmap.filters = []; + obj.tile.tilesetTile.image.bitmap.rotation = 0; + obj.tile.tilesetTile.image.bitmap.scaleX = scale.x; + obj.tile.tilesetTile.image.bitmap.scaleY = scale.y; break; case es.TmxObjectType.ellipse: pos = new es.Vector2(obj.x + obj.width * 0.5, obj.y + obj.height * 0.5).multiply(scale); + if (!obj.shape.parent) + container.addChild(obj.shape); + es.DrawUtils.drawCircle(obj.shape, pos, obj.width * 0.5, objGroup.color); break; case es.TmxObjectType.polygon: case es.TmxObjectType.polyline: var points = []; for (var i = 0; i < obj.points.length; i++) points[i] = es.Vector2.multiply(obj.points[i], scale); + es.DrawUtils.drawPoints(obj.shape, pos, points, objGroup.color, obj.objectType == es.TmxObjectType.polygon); break; case es.TmxObjectType.text: + if (!obj.textField.parent) + container.addChild(obj.textField); + es.DrawUtils.drawString(obj.textField, obj.text.value, pos, obj.text.color, es.MathHelper.toRadians(obj.rotation), es.Vector2.zero, 1); break; default: + if (es.Core.debugRenderEndabled) { + if (!obj.textField.parent) + container.addChild(obj.textField); + es.DrawUtils.drawString(obj.textField, obj.name + "(" + obj.type + ")", es.Vector2.subtract(pos, new es.Vector2(0, 15)), 0xffffff, 0, es.Vector2.zero, 1); + } break; } } }; - TiledRendering.renderGroup = function (group, position, scale, layerDepth) { + TiledRendering.renderGroup = function (group, container, position, scale, layerDepth) { var _this = this; if (!group.visible) return; group.layers.forEach(function (layer) { if (layer instanceof es.TmxGroup) { - _this.renderGroup(layer, position, scale, layerDepth); + _this.renderGroup(layer, container, position, scale, layerDepth); } if (layer instanceof es.TmxObjectGroup) { - _this.renderObjectGroup(layer, position, scale, layerDepth); + _this.renderObjectGroup(layer, container, position, scale, layerDepth); } if (layer instanceof es.TmxLayer) { - _this.renderLayer(layer, position, scale, layerDepth); + _this.renderLayer(layer, container, position, scale, layerDepth); } if (layer instanceof es.TmxImageLayer) { - _this.renderImageLayer(layer, position, scale, layerDepth); + _this.renderImageLayer(layer, container, position, scale, layerDepth); } }); }; - TiledRendering.renderTile = function (tile, position, scale, tileWidth, tileHeight, color, layerDepth) { + TiledRendering.renderTile = function (tile, container, position, scale, tileWidth, tileHeight, color, layerDepth) { var gid = tile.gid; var tilesetTile = tile.tilesetTile; if (tilesetTile && tilesetTile.animationFrames.length > 0) @@ -7935,8 +8378,24 @@ var es; ty += (tileHeight - sourceRect.height * scale.y); var pos = new es.Vector2(tx, ty).add(position); if (tile.tileset.image) { + if (!tile.tilesetTile.image.bitmap.parent) + container.addChild(tile.tilesetTile.image.bitmap); + tile.tilesetTile.image.bitmap.x = pos.x; + tile.tilesetTile.image.bitmap.y = pos.y; + tile.tilesetTile.image.bitmap.scaleX = scale.x; + tile.tilesetTile.image.bitmap.scaleY = scale.y; + tile.tilesetTile.image.bitmap.rotation = rotation; + tile.tilesetTile.image.bitmap.filters = [color]; } else { + if (!tilesetTile.image.bitmap) + container.addChild(tilesetTile.image.bitmap); + tilesetTile.image.bitmap.x = pos.x; + tilesetTile.image.bitmap.y = pos.y; + tilesetTile.image.bitmap.scaleX = scale.x; + tilesetTile.image.bitmap.scaleY = scale.y; + tilesetTile.image.bitmap.rotation = rotation; + tilesetTile.image.bitmap.filters = [color]; } }; return TiledRendering; @@ -8020,6 +8479,41 @@ var es; }()); es.TmxAnimationFrame = TmxAnimationFrame; })(es || (es = {})); +var es; +(function (es) { + var TmxUtils = (function () { + function TmxUtils() { + } + TmxUtils.decode = function (data, encoding, compression) { + compression = compression || "none"; + encoding = encoding || "none"; + var text = data.children[0].text; + switch (encoding) { + case "base64": + var decoded = es.Base64Utils.decodeBase64AsArray(text, 4); + return (compression === "none") ? decoded : es.Base64Utils.decompress(text, decoded, compression); + case "csv": + return es.Base64Utils.decodeCSV(text); + case "none": + var datas = []; + for (var i = 0; i < data.children.length; i++) { + datas[i] = +data.children[i].attributes.gid; + } + return datas; + default: + throw new Error("未定义的编码:" + encoding); + } + }; + TmxUtils.color16ToUnit = function ($color) { + if (!$color) + return 0x000000; + var colorStr = "0x" + $color.slice(1); + return parseInt(colorStr, 16); + }; + return TmxUtils; + }()); + es.TmxUtils = TmxUtils; +})(es || (es = {})); var ArrayUtils = (function () { function ArrayUtils() { } @@ -8184,128 +8678,103 @@ var ArrayUtils = (function () { }; return ArrayUtils; }()); -var Base64Utils = (function () { - function Base64Utils() { - } - Base64Utils.decode = function (input, isNotStr) { - if (isNotStr === void 0) { isNotStr = true; } - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - input = this.getConfKey(input); - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - while (i < input.length) { - enc1 = this._keyAll.indexOf(input.charAt(i++)); - enc2 = this._keyAll.indexOf(input.charAt(i++)); - enc3 = this._keyAll.indexOf(input.charAt(i++)); - enc4 = this._keyAll.indexOf(input.charAt(i++)); - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - output = output + String.fromCharCode(chr1); - if (enc3 != 64) { - if (chr2 == 0) { - if (isNotStr) - output = output + String.fromCharCode(chr2); - } - else { - output = output + String.fromCharCode(chr2); - } - } - if (enc4 != 64) { - if (chr3 == 0) { - if (isNotStr) - output = output + String.fromCharCode(chr3); - } - else { - output = output + String.fromCharCode(chr3); - } - } +var es; +(function (es) { + var Base64Utils = (function () { + function Base64Utils() { } - output = this._utf8_decode(output); - return output; - }; - Base64Utils._utf8_encode = function (string) { - string = string.replace(/\r\n/g, "\n"); - var utftext = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if ((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); + Object.defineProperty(Base64Utils, "nativeBase64", { + get: function () { + return (typeof (window.atob) === "function"); + }, + enumerable: true, + configurable: true + }); + Base64Utils.decode = function (input) { + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + if (this.nativeBase64) { + return window.atob(input); } else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); + var output = [], chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0; + while (i < input.length) { + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output.push(String.fromCharCode(chr1)); + if (enc3 !== 64) { + output.push(String.fromCharCode(chr2)); + } + if (enc4 !== 64) { + output.push(String.fromCharCode(chr3)); + } + } + output = output.join(""); + return output; } - } - return utftext; - }; - Base64Utils._utf8_decode = function (utftext) { - var string = ""; - var i = 0; - var c = 0; - var c1 = 0; - var c2 = 0; - var c3 = 0; - while (i < utftext.length) { - c = utftext.charCodeAt(i); - if (c < 128) { - string += String.fromCharCode(c); - i++; - } - else if ((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i + 1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; + }; + Base64Utils.encode = function (input) { + input = input.replace(/\r\n/g, "\n"); + if (this.nativeBase64) { + window.btoa(input); } else { - c2 = utftext.charCodeAt(i + 1); - c3 = utftext.charCodeAt(i + 2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; + var output = [], chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0; + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } + else if (isNaN(chr3)) { + enc4 = 64; + } + output.push(this._keyStr.charAt(enc1)); + output.push(this._keyStr.charAt(enc2)); + output.push(this._keyStr.charAt(enc3)); + output.push(this._keyStr.charAt(enc4)); + } + output = output.join(""); + return output; } - } - return string; - }; - Base64Utils.getConfKey = function (key) { - return key.slice(1, key.length); - }; - Base64Utils._keyNum = "0123456789+/"; - Base64Utils._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - Base64Utils._keyAll = Base64Utils._keyNum + Base64Utils._keyStr; - Base64Utils.encode = function (input) { - var output = ""; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0; - input = this._utf8_encode(input); - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - if (isNaN(chr2)) { - enc3 = enc4 = 64; + }; + Base64Utils.decodeBase64AsArray = function (input, bytes) { + bytes = bytes || 1; + var dec = Base64Utils.decode(input), i, j, len; + var ar = new Uint32Array(dec.length / bytes); + for (i = 0, len = dec.length / bytes; i < len; i++) { + ar[i] = 0; + for (j = bytes - 1; j >= 0; --j) { + ar[i] += dec.charCodeAt((i * bytes) + j) << (j << 3); + } } - else if (isNaN(chr3)) { - enc4 = 64; + return ar; + }; + Base64Utils.decompress = function (data, decoded, compression) { + throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!"); + }; + Base64Utils.decodeCSV = function (input) { + var entries = input.replace("\n", "").trim().split(","); + var result = []; + for (var i = 0; i < entries.length; i++) { + result.push(+entries[i]); } - output = output + - this._keyAll.charAt(enc1) + this._keyAll.charAt(enc2) + - this._keyAll.charAt(enc3) + this._keyAll.charAt(enc4); - } - return this._keyStr.charAt(Math.floor((Math.random() * this._keyStr.length))) + output; - }; - return Base64Utils; -}()); + return result; + }; + Base64Utils._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + return Base64Utils; + }()); + es.Base64Utils = Base64Utils; +})(es || (es = {})); var es; (function (es) { var Color = (function () { @@ -8433,6 +8902,23 @@ var es; if (thickness === void 0) { thickness = 1; } this.drawLineAngle(shape, start, es.MathHelper.angleBetweenVectors(start, end), es.Vector2.distance(start, end), color, thickness); }; + DrawUtils.drawCircle = function (shape, position, radius, color) { + shape.graphics.beginFill(color); + shape.graphics.drawCircle(position.x, position.y, radius); + shape.graphics.endFill(); + }; + DrawUtils.drawPoints = function (shape, position, points, color, closePoly, thickness) { + if (closePoly === void 0) { closePoly = true; } + if (thickness === void 0) { thickness = 1; } + if (points.length < 2) + return; + for (var i = 1; i < points.length; i++) + this.drawLine(shape, es.Vector2.add(position, points[i - 1]), es.Vector2.add(position, points[i]), color, thickness); + if (closePoly) + this.drawLine(shape, es.Vector2.add(position, points[points.length - 1]), es.Vector2.add(position, points[0]), color, thickness); + }; + DrawUtils.drawString = function (textField, text, position, color, rotation, origin, scale) { + }; DrawUtils.drawLineAngle = function (shape, start, radians, length, color, thickness) { if (thickness === void 0) { thickness = 1; } shape.graphics.beginFill(color); diff --git a/demo/libs/framework/framework.min.js b/demo/libs/framework/framework.min.js index cc518cb6..3bc92582 100644 --- a/demo/libs/framework/framework.min.js +++ b/demo/libs/framework/framework.min.js @@ -1 +1 @@ -window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}c((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===c())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return e.zeroVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return e.unitVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return e.unitXVector},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return e.unitYVector},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var e=1/Math.sqrt(t.x*t.x+t.y*t.y);return t.x*=e,t.y*=e,t},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=t,this.y*=t,this},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e.unitYVector=new e(0,1),e.unitXVector=new e(1,0),e.unitVector2=new e(1,1),e.zeroVector2=new e(0,0),e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=e}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:t.DrawUtils.drawLine(i,this.start,this.end,this.color);break;case e.hollowRectangle:t.DrawUtils.drawHollowRect(i,this.rectangle,this.color);break;case e.pixel:t.DrawUtils.drawPixel(i,new t.Vector2(this.x,this.y),this.color,this.size);break;case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e.prototype.clone=function(){var t=ObjectUtils.clone(this);return t.entity=null,t},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance._scene=t,this._instance.addChild(t),this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),this.addChild(this._scene),[4,this._scene.begin()]):[3,2];case 1:i.sent(),i.label=2;case 2:return[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),this.initialize()},i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},r.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},r.prototype.zoomIn=function(t){this.zoom+=t},r.prototype.zoomOut=function(t){this.zoom-=t},r.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._transformMatrix)},r.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._inverseTransformMatrix)},r.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},r.prototype.onAddedToEntity=function(){this.follow(this._targetEntity,this._cameraStyle)},r.prototype.update=function(){var e=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5));this._worldSpaceDeadZone.x=this.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.position=t.Vector2.lerp(this.position,t.Vector2.add(this.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.position=this.clampToMapSize(this.position),this.entity.transform.roundPosition())},r.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},r.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},r.prototype.follow=function(i,n){switch(void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n,this._cameraStyle){case e.cameraWindow:var r=this.bounds.width/6,o=this.bounds.height/3;this.deadzone=new t.Rectangle((this.bounds.width-r)/2,(this.bounds.height-o)/2,r,o);break;case e.lockOn:this.deadzone=new t.Rectangle(this.bounds.width/2,this.bounds.height/2,10,10)}},r.prototype.setCenteredDeadzone=function(e,i){this.deadzone=new t.Rectangle((this.bounds.width-e)/2,(this.bounds.height-i)/2,e,i)},r.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},r}(t.Component);t.Camera=n}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.color=0,i._areBoundsDirty=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.isVisibleFromCamera=function(t){return this.isVisible=t.bounds.intersects(this.bounds),this.isVisible},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(t){this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y,this.displayObject.scaleX=this.entity.scale.x,this.displayObject.scaleY=this.entity.scale.y,this.displayObject.rotation=this.entity.rotation},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(t){this.sync(t),this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=function(){return function(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}}();t.Sprite=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.sprites=t,this.frameRate=e}}();t.SpriteAnimation=e}(es||(es={})),function(t){var e,i;!function(t){t[t.loop=0]="loop",t[t.once=1]="once",t[t.clampForever=2]="clampForever",t[t.pingPong=3]="pingPong",t[t.pingPongOnce=4]="pingPongOnce"}(e=t.LoopMode||(t.LoopMode={})),function(t){t[t.none=0]="none",t[t.running=1]="running",t[t.paused=2]="paused",t[t.completed=3]="completed"}(i=t.State||(t.State={}));var n=function(n){function r(t){var e=n.call(this,t)||this;return e.speed=1,e.animationState=i.none,e._elapsedTime=0,e._animations=new Map,e}return __extends(r,n),Object.defineProperty(r.prototype,"isRunning",{get:function(){return this.animationState==i.running},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"animations",{get:function(){return this._animations},enumerable:!0,configurable:!0}),r.prototype.update=function(){if(this.animationState==i.running&&this.currentAnimation){var n=this.currentAnimation,r=1/(n.frameRate*this.speed),o=r*n.sprites.length;this._elapsedTime+=t.Time.deltaTime;var s=Math.abs(this._elapsedTime);if(this._loopMode==e.once&&s>o||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.sprite=n.sprites[this.currentFrame]);var a=Math.floor(s/r),c=n.sprites.length;if(c>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var h=c-1;this.currentFrame=h-Math.abs(h-a%(2*h))}else this.currentFrame=a%c;this.sprite=n.sprites[this.currentFrame]}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.sprite=this.currentAnimation.sprites[0],this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(t,i,n){void 0===i&&(i=null),void 0===n&&(n=!0);var r=e.call(this)||this;return r.physicsLayer=1,r.tiledMap=t,r._shouldCreateColliders=n,i&&(r.collisionLayer=t.tileLayers.get(i)),r}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var c=void 0;e.$renderBuffer?c=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(c=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var h=c.$renderBuffer.getPixels(i.x,i.y,o,s),u=0,l=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,c=Math.floor(a)+1;if(53==c){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var h=i.getDay();if(0==h&&(h=7),e&&(!o||h<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(c>9?"":"0")+c)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),c=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(c="0"+c),i?s+e+a+e+c:a+e+c},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.camera=e,this.renderOrder=t}return t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t}();t.Renderer=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,0,null)||this}return __extends(e,t),e.prototype.render=function(t){var e=this.camera?this.camera:t.camera;this.beginRender(e);for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.Epsilon=1e-5,e.Rad2Deg=57.29578,e.Deg2Rad=.0174532924,e.PiOver2=Math.PI/2,e}();t.MathHelper=e}(es||(es={})),function(t){t.matrixPool=[];var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"m11",{get:function(){return this.a},set:function(t){this.a=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m12",{get:function(){return this.b},set:function(t){this.b=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m21",{get:function(){return this.c},set:function(t){this.c=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m22",{get:function(){return this.d},set:function(t){this.d=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m31",{get:function(){return this.tx},set:function(t){this.tx=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m32",{get:function(){return this.ty},set:function(t){this.ty=t},enumerable:!0,configurable:!0}),i.create=function(){var e=t.matrixPool.pop();return e||(e=new i),e},i.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return 1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e),this},i.prototype.rotate=function(t){if(0!==(t=+t)){t/=DEG_TO_RAD;var e=Math.cos(t),i=Math.sin(t),n=this.a,r=this.b,o=this.c,s=this.d,a=this.tx,c=this.ty;this.a=n*e-r*i,this.b=n*i+r*e,this.c=o*e-s*i,this.d=o*i+s*e,this.tx=a*e-c*i,this.ty=a*i+c*e}return this},i.prototype.invert=function(){return this.$invertInto(this),this},i.prototype.add=function(t){return this.m11+=t.m11,this.m12+=t.m12,this.m21+=t.m21,this.m22+=t.m22,this.m31+=t.m31,this.m32+=t.m32,this},i.prototype.substract=function(t){return this.m11-=t.m11,this.m12-=t.m12,this.m21-=t.m21,this.m22-=t.m22,this.m31-=t.m31,this.m32-=t.m32,this},i.prototype.divide=function(t){return this.m11/=t.m11,this.m12/=t.m12,this.m21/=t.m21,this.m22/=t.m22,this.m31/=t.m31,this.m32/=t.m32,this},i.prototype.multiply=function(t){var e=this.m11*t.m11+this.m12*t.m21,i=this.m11*t.m12+this.m12*t.m22,n=this.m21*t.m11+this.m22*t.m21,r=this.m21*t.m12+this.m22*t.m22,o=this.m31*t.m11+this.m32*t.m21+t.m31,s=this.m31*t.m12+this.m32*t.m22+t.m32;return this.m11=e,this.m12=i,this.m21=n,this.m22=r,this.m31=o,this.m32=s,this},i.prototype.determinant=function(){return this.m11*this.m22-this.m12*this.m21},i.prototype.release=function(e){e&&t.matrixPool.push(e)},i}(egret.Matrix);t.Matrix2D=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"max",{get:function(){return new t.Vector2(this.right,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"center",{get:function(){return new t.Vector2(this.x+this.width/2,this.y+this.height/2)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return new t.Vector2(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){return new t.Vector2(this.width,this.height)},set:function(t){this.width=t.x,this.height=t.y},enumerable:!0,configurable:!0}),i.fromMinMax=function(t,e,n,r){return new i(t,e,n-t,r-e)},i.rectEncompassingPoints=function(t){for(var e=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=0;on&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return e}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if((e=Math.max(r,e))>(i=Math.min(o,i)))return e}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return e}else{var a=1/t.direction.y,c=(this.y-t.start.y)*a,h=(this.y+this.height-t.start.y)*a;if(c>h){var u=c;c=h,h=u}if((e=Math.max(c,e))>(i=Math.max(h,i)))return e}return e},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var u=(c.x*o.y-c.y*o.x)/a;return!(u<0||u>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),c=s.x*a.y-s.y*a.x;if(0==c)return o;var h=t.Vector2.subtract(n,e),u=(h.x*a.y-h.y*a.x)/c;if(u<0||u>1)return o;var l=(h.x*s.y-h.y*s.x)/c;return l<0||l>1?o:o=t.Vector2.add(e,new t.Vector2(u*s.x,u*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.isCircleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.isCircleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.clone=function(){return ObjectUtils.clone(this)},t}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);o=t.Vector2.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n=Number.MAX_VALUE,r=new t.Vector2(0,0);for(var o,s=new t.Vector2(0,0),a=0;ae.y!=this.points[r].y>e.y&&e.x<(this.points[r].x-this.points[n].x)*(e.y-this.points[n].y)/(this.points[r].y-this.points[n].y)+this.points[n].x&&(i=!i);return i},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return s;var a,c=t.Vector2.add(o.start,t.Vector2.add(o.direction,new t.Vector2(s))),h=0;c.xi.bounds.right&&(h|=1),c.yi.bounds.bottom&&(h|=2);var u=a+h;return 3==u&&console.log("m == 3. corner "+t.Time.frameCount),s},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,c=Number.POSITIVE_INFINITY,h=new t.Vector2,u=t.Vector2.subtract(e.position,i.position),l=0;l0&&(o=!1),!o)return!1;(g=Math.abs(g))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,0,n.normal),a=i.containsPoint(e.position);if(0>e.radius*e.radius&&!a)return!1;a?r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(0)-e.radius)):r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));return n.minimumTranslationVector=r,n.point=t.Vector2.add(s,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,n.normal=t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var l=(h.x*s.y-h.y*s.x)/c;return!(l<0||l>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(u),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),c=t.Vector2.dot(a,s),h=t.Vector2.dot(a,a)-n.radius*n.radius;if(h>0&&c>0)return!1;var u=c*c-h;return!(u<0)&&(r.fraction=-c-Math.sqrt(u),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal=r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),c=o.rayIntersects(a);return c<=1&&(r.fraction=c,r.distance=n.length()*c,r.normal=new t.Vector2(-n.x),r.normal=r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(c))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var c=this.cellAtPosition(s,a);if(c)for(var h=function(r){var o=c[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer))return"continue";e.intersects(o.bounds)&&(u._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||u._tempHashSet.push(o))},u=this,l=0;l=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.size-1;e>=0;e--)if(this.tilesets.get(e.toString()).firstGid<=t)return this.tilesets.get(e.toString());console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers.get(t)},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=function(){function e(){}return e.renderMap=function(e,i,n,r){var o=this;e.layers.forEach(function(e){e instanceof t.TmxLayer&&e.visible?o.renderLayer(e,i,n,r):e instanceof t.TmxImageLayer&&e.visible?o.renderImageLayer(e,i,n,r):e instanceof t.TmxGroup&&e.visible?o.renderGroup(e,i,n,r):e instanceof t.TmxObjectGroup&&e.visible&&o.renderObjectGroup(e,i,n,r)})},e.renderLayer=function(e,i,n,r){if(e.visible)for(var o=e.map.tileWidth*n.x,s=e.map.tileHeight*n.y,a=new t.Color(0,0,0,255*e.opacity),c=0;c0&&(c=h.currentAnimationFrameGid);var u=e.tileset.tileRegions.get(c),l=e.x*r,p=e.y*o,f=0;e.diagonalFlip&&(e.horizontalFlip&&e.verticalFlip?(f=t.MathHelper.PiOver2,l+=o+(u.height*n.y-o),p-=u.width*n.x-r):e.horizontalFlip?(f=-t.MathHelper.PiOver2,p+=o):e.verticalFlip?(f=t.MathHelper.PiOver2,l+=r+(u.height*n.y-o),p+=r-u.width*n.x):(f=-t.MathHelper.PiOver2,p+=o)),0==f&&(p+=o-u.height*n.y);new t.Vector2(l,p).add(i);e.tileset.image},e}();t.TiledRendering=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={}));var ArrayUtils=function(){function t(){}return t.bubbleSort=function(t){for(var e=!1,i=0;ii;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}(),Base64Utils=function(){function t(){}return t.decode=function(t,e){void 0===e&&(e=!0);var i,n,r,o,s,a,c="",h=0;for(t=(t=this.getConfKey(t)).replace(/[^A-Za-z0-9\+\/\=]/g,"");h>4,n=(15&o)<<4|(s=this._keyAll.indexOf(t.charAt(h++)))>>2,r=(3&s)<<6|(a=this._keyAll.indexOf(t.charAt(h++))),c+=String.fromCharCode(i),64!=s&&(0==n?e&&(c+=String.fromCharCode(n)):c+=String.fromCharCode(n)),64!=a&&(0==r?e&&(c+=String.fromCharCode(r)):c+=String.fromCharCode(r));return c=this._utf8_decode(c)},t._utf8_encode=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e},t._utf8_decode=function(t){for(var e="",i=0,n=0,r=0,o=0;i191&&n<224?(r=t.charCodeAt(i+1),e+=String.fromCharCode((31&n)<<6|63&r),i+=2):(r=t.charCodeAt(i+1),o=t.charCodeAt(i+2),e+=String.fromCharCode((15&n)<<12|(63&r)<<6|63&o),i+=3);return e},t.getConfKey=function(t){return t.slice(1,t.length)},t._keyNum="0123456789+/",t._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",t._keyAll=t._keyNum+t._keyStr,t.encode=function(t){var e,i,n,r,o,s,a,c="",h=0;for(t=this._utf8_encode(t);h>2,o=(3&e)<<4|(i=t.charCodeAt(h++))>>4,s=(15&i)<<2|(n=t.charCodeAt(h++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),c=c+this._keyAll.charAt(r)+this._keyAll.charAt(o)+this._keyAll.charAt(s)+this._keyAll.charAt(a);return this._keyStr.charAt(Math.floor(Math.random()*this._keyStr.length))+c},t}();!function(t){var e=function(){function e(e,i,n,r){if(0!=(4294967040&(e|i|n|r))){var o=t.MathHelper.clamp(e,0,255),s=t.MathHelper.clamp(i,0,255),a=t.MathHelper.clamp(n,0,255),c=t.MathHelper.clamp(r,0,255);this._packedValue=c<<24|a<<16|s<<8|o}else this._packedValue=r<<24|n<<16|i<<8|e}return Object.defineProperty(e.prototype,"b",{get:function(){return this._packedValue>>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){t.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function e(){}return e.drawLine=function(e,i,n,r,o){void 0===o&&(o=1),this.drawLineAngle(e,i,t.MathHelper.angleBetweenVectors(i,n),t.Vector2.distance(i,n),r,o)},e.drawLineAngle=function(t,e,i,n,r,o){void 0===o&&(o=1),t.graphics.beginFill(r),t.graphics.drawRect(e.x,e.y,1,1),t.graphics.endFill(),t.scaleX=n,t.scaleY=o,t.$anchorOffsetX=0,t.$anchorOffsetY=0,t.rotation=i},e.drawHollowRect=function(t,e,i,n){void 0===n&&(n=1),this.drawHollowRectR(t,e.x,e.y,e.width,e.height,i,n)},e.drawHollowRectR=function(e,i,n,r,o,s,a){void 0===a&&(a=1);var c=new t.Vector2(i,n).round(),h=new t.Vector2(i+r,n).round(),u=new t.Vector2(i+r,n+o).round(),l=new t.Vector2(i,n+o).round();this.drawLine(e,c,h,s,a),this.drawLine(e,h,u,s,a),this.drawLine(e,u,l,s,a),this.drawLine(e,l,c,s,a)},e.drawPixel=function(e,i,n,r){void 0===r&&(r=1);var o=new t.Rectangle(i.x,i.y,r,r);1!=r&&(o.x-=.5*r,o.y-=.5*r),e.graphics.beginFill(n),e.graphics.drawRect(o.x,o.y,o.width,o.height),e.graphics.endFill()},e.getColorMatrix=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];return e[0]=Math.floor(t/256/256)/255,e[6]=Math.floor(t/256%256)/255,e[12]=t%256/255,new egret.ColorMatrixFilter(e)},e}();t.DrawUtils=e}(es||(es={})),function(t){var e=function(){function e(){}return e.oppositeEdge=function(e){switch(e){case t.Edge.bottom:return t.Edge.top;case t.Edge.top:return t.Edge.bottom;case t.Edge.left:return t.Edge.right;case t.Edge.right:return t.Edge.left}},e.isHorizontal=function(e){return e==t.Edge.right||e==t.Edge.left},e.isVertical=function(e){return e==t.Edge.top||e==t.Edge.bottom},e}();t.EdgeExt=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.func=t,this.context=e}}();t.FuncPack=e;var i=function(){function t(){this._messageTable=new Map}return t.prototype.addObserver=function(t,i,n){var r=this._messageTable.get(t);r||(r=[],this._messageTable.set(t,r)),-1!=r.findIndex(function(t){return t.func==i})&&console.warn("您试图添加相同的观察者两次"),r.push(new e(i,n))},t.prototype.removeObserver=function(t,e){var i=this._messageTable.get(t),n=i.findIndex(function(t){return t.func==e});-1!=n&&i.removeAt(n)},t.prototype.emit=function(t,e){var i=this._messageTable.get(t);if(i)for(var n=i.length-1;n>=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function e(){this.x=0,this.y=0,this.touchPoint=-1,this.touchDown=!1}return Object.defineProperty(e.prototype,"position",{get:function(){return new t.Vector2(this.x,this.y)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.x=0,this.y=0,this.touchDown=!1,this.touchPoint=-1},e}();t.TouchState=e;var i=function(){function i(){}return Object.defineProperty(i,"gameTouchs",{get:function(){return this._gameTouchs},enumerable:!0,configurable:!0}),Object.defineProperty(i,"resolutionScale",{get:function(){return this._resolutionScale},enumerable:!0,configurable:!0}),Object.defineProperty(i,"totalTouchCount",{get:function(){return this._totalTouchCount},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPosition",{get:function(){return this._gameTouchs[0]?this._gameTouchs[0].position:t.Vector2.zero},enumerable:!0,configurable:!0}),Object.defineProperty(i,"maxSupportedTouch",{get:function(){return t.Core._instance.stage.maxTouches},set:function(e){t.Core._instance.stage.maxTouches=e,this.initTouchCache()},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPositionDelta",{get:function(){var e=t.Vector2.subtract(this.touchPosition,this._previousTouchState.position);return e.length()>0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.scaledPosition=function(e){var i=new t.Vector2(e.x-this._resolutionOffset.x,e.y-this._resolutionOffset.y);return t.Vector2.multiply(i,this.resolutionScale)},i.initTouchCache=function(){this._totalTouchCount=0,this._touchIndex=0,this._gameTouchs.length=0;for(var t=0;t0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={}));var THREAD_ID=Math.floor(1e3*Math.random())+"-"+Date.now(),nextTick=function(t){setTimeout(t,0)},LockUtils=function(){function t(t){this._keyX="mutex_key_"+t+"_X",this._keyY="mutex_key_"+t+"_Y",this.setItem=egret.localStorage.setItem.bind(localStorage),this.getItem=egret.localStorage.getItem.bind(localStorage),this.removeItem=egret.localStorage.removeItem.bind(localStorage)}return t.prototype.lock=function(){var t=this;return new Promise(function(e,i){var n=function(){t.setItem(t._keyX,THREAD_ID),null===!t.getItem(t._keyY)&&nextTick(n),t.setItem(t._keyY,THREAD_ID),t.getItem(t._keyX)!==THREAD_ID?setTimeout(function(){t.getItem(t._keyY)===THREAD_ID?(e(),t.removeItem(t._keyY)):nextTick(n)},10):(e(),t.removeItem(t._keyY))};n()})},t}();!function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,c=i[this._triPrev[s]],h=i[s],u=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(c,h,u)){var l=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[l],c,h,u)){a=!1;break}l=this._triNext[l]}while(l!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e=t.Vector2.divide(e,new t.Vector2(i)):e.x=e.y=0,e},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this._frameKey="frame",this._logKey="log",this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[r].snapMin=l.logs[r].min,l.logs[r].snapMax=l.logs[r].max,l.logs[r].snapAvg=l.logs[r].avg,l.logs[r].samples=0)):(l.logs[r].min=h,l.logs[r].max=h,l.logs[r].avg=h,l.logs[r].initialized=!0)}s.markCount=o.nestCount,s.nestCount=o.nestCount}t.stopwacth.reset(),t.stopwacth.start()}})},e.prototype.beginMark=function(t,i,n){var r=this;void 0===n&&(n=0),new LockUtils(this._frameKey).lock().then(function(){if(n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var o=r._curLog.bars[n];if(o.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(o.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var s=r._markerNameToIdMap.get(t);isNaN(s)&&(s=r.markers.length,r._markerNameToIdMap.set(t,s)),o.markerNests[o.nestCount++]=o.markCount,o.markers[o.markCount].markerId=s,o.markers[o.markCount].color=i,o.markers[o.markCount].beginTime=r.stopwacth.getTime(),o.markers[o.markCount].endTime=-1})},e.prototype.endMark=function(t,i){var n=this;void 0===i&&(i=0),new LockUtils(this._frameKey).lock().then(function(){if(i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var r=n._curLog.bars[i];if(r.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var o=n._markerNameToIdMap.get(t);if(isNaN(o))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var s=r.markerNests[--r.nestCount];if(r.markers[s].markerId!=o)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");r.markers[s].endTime=n.stopwacth.getTime()})},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){var t=this;new LockUtils(this._logKey).lock().then(function(){var e=parseInt(egret.localStorage.getItem(t._logKey),10);e+=1,egret.localStorage.setItem(t._logKey,e.toString()),t.markers.forEach(function(t){for(var e=0;e0&&(n+=e.barHeight+2*e.barPadding,r=Math.max(r,t.markers[t.markCount-1].endTime))});var o=this.sampleFrames*(1/60*1e3);this._frameAdjust=r>o?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,r/(1/60*1e3)+1),this._frameAdjust=0);t.y,e.barHeight}},e.prototype.onGraphicsDeviceReset=function(){var i=new t.Layout;this._position=i.place(new t.Vector2(this.width,e.barHeight),0,.01,t.Alignment.bottomCenter).location},e.maxBars=8,e.maxSamples=256,e.maxNestCall=32,e.barHeight=8,e.maxSampleFrames=4,e.logSnapDuration=120,e.barPadding=2,e.autoAdjustDelay=30,e}();t.TimeRuler=e;var i=function(){return function(){this.bars=new Array(e.maxBars),this.bars.fill(new n,0,e.maxBars)}}();t.FrameLog=i;var n=function(){return function(){this.markers=new Array(e.maxSamples),this.markCount=0,this.markerNests=new Array(e.maxNestCall),this.nestCount=0,this.markers.fill(new r,0,e.maxSamples),this.markerNests.fill(0,0,e.maxNestCall)}}();t.MarkerCollection=n;var r=function(){return function(){this.markerId=0,this.beginTime=0,this.endTime=0,this.color=0}}();t.Marker=r;var o=function(){return function(t){this.logs=new Array(e.maxBars),this.name=t,this.logs.fill(new s,0,e.maxBars)}}();t.MarkerInfo=o;var s=function(){return function(){this.snapMin=0,this.snapMax=0,this.snapAvg=0,this.min=0,this.max=0,this.avg=0,this.samples=0,this.color=0,this.initialized=!1}}();t.MarkerLog=s}(es||(es={})); \ No newline at end of file +window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}c((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===c())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return e.zeroVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return e.unitVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return e.unitXVector},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return e.unitYVector},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var e=1/Math.sqrt(t.x*t.x+t.y*t.y);return t.x*=e,t.y*=e,t},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=t,this.y*=t,this},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e.unitYVector=new e(0,1),e.unitXVector=new e(1,0),e.unitVector2=new e(1,1),e.zeroVector2=new e(0,0),e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=e}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:t.DrawUtils.drawLine(i,this.start,this.end,this.color);break;case e.hollowRectangle:t.DrawUtils.drawHollowRect(i,this.rectangle,this.color);break;case e.pixel:t.DrawUtils.drawPixel(i,new t.Vector2(this.x,this.y),this.color,this.size);break;case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e.prototype.clone=function(){var t=ObjectUtils.clone(this);return t.entity=null,t},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance._scene=t,this._instance.addChild(t),this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),this.addChild(this._scene),[4,this._scene.begin()]):[3,2];case 1:i.sent(),i.label=2;case 2:return[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),this.initialize()},i.debugRenderEndabled=!1,i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},r.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},r.prototype.zoomIn=function(t){this.zoom+=t},r.prototype.zoomOut=function(t){this.zoom-=t},r.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._transformMatrix)},r.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._inverseTransformMatrix)},r.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},r.prototype.onAddedToEntity=function(){this.follow(this._targetEntity,this._cameraStyle)},r.prototype.update=function(){var e=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5));this._worldSpaceDeadZone.x=this.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.position=t.Vector2.lerp(this.position,t.Vector2.add(this.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.position=this.clampToMapSize(this.position),this.entity.transform.roundPosition())},r.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},r.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},r.prototype.follow=function(i,n){switch(void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n,this._cameraStyle){case e.cameraWindow:var r=this.bounds.width/6,o=this.bounds.height/3;this.deadzone=new t.Rectangle((this.bounds.width-r)/2,(this.bounds.height-o)/2,r,o);break;case e.lockOn:this.deadzone=new t.Rectangle(this.bounds.width/2,this.bounds.height/2,10,10)}},r.prototype.setCenteredDeadzone=function(e,i){this.deadzone=new t.Rectangle((this.bounds.width-e)/2,(this.bounds.height-i)/2,e,i)},r.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},r}(t.Component);t.Camera=n}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.color=0,i._areBoundsDirty=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.isVisibleFromCamera=function(t){return this.isVisible=t.bounds.intersects(this.bounds),this.isVisible},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(t){this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y,this.displayObject.scaleX=this.entity.scale.x,this.displayObject.scaleY=this.entity.scale.y,this.displayObject.rotation=this.entity.rotation},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(t){this.sync(t),this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=function(){return function(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}}();t.Sprite=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.sprites=t,this.frameRate=e}}();t.SpriteAnimation=e}(es||(es={})),function(t){var e,i;!function(t){t[t.loop=0]="loop",t[t.once=1]="once",t[t.clampForever=2]="clampForever",t[t.pingPong=3]="pingPong",t[t.pingPongOnce=4]="pingPongOnce"}(e=t.LoopMode||(t.LoopMode={})),function(t){t[t.none=0]="none",t[t.running=1]="running",t[t.paused=2]="paused",t[t.completed=3]="completed"}(i=t.State||(t.State={}));var n=function(n){function r(t){var e=n.call(this,t)||this;return e.speed=1,e.animationState=i.none,e._elapsedTime=0,e._animations=new Map,e}return __extends(r,n),Object.defineProperty(r.prototype,"isRunning",{get:function(){return this.animationState==i.running},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"animations",{get:function(){return this._animations},enumerable:!0,configurable:!0}),r.prototype.update=function(){if(this.animationState==i.running&&this.currentAnimation){var n=this.currentAnimation,r=1/(n.frameRate*this.speed),o=r*n.sprites.length;this._elapsedTime+=t.Time.deltaTime;var s=Math.abs(this._elapsedTime);if(this._loopMode==e.once&&s>o||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.sprite=n.sprites[this.currentFrame]);var a=Math.floor(s/r),c=n.sprites.length;if(c>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var h=c-1;this.currentFrame=h-Math.abs(h-a%(2*h))}else this.currentFrame=a%c;this.sprite=n.sprites[this.currentFrame]}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.sprite=this.currentAnimation.sprites[0],this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(t,i,n){void 0===i&&(i=null),void 0===n&&(n=!0);var r=e.call(this)||this;return r.physicsLayer=1,r.tiledMap=t,r._shouldCreateColliders=n,r.displayObject=new egret.DisplayObjectContainer,i&&(r.collisionLayer=t.tileLayers[i]),r}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var c=void 0;e.$renderBuffer?c=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(c=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var h=c.$renderBuffer.getPixels(i.x,i.y,o,s),u=0,l=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,c=Math.floor(a)+1;if(53==c){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var h=i.getDay();if(0==h&&(h=7),e&&(!o||h<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(c>9?"":"0")+c)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),c=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(c="0"+c),i?s+e+a+e+c:a+e+c},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.camera=e,this.renderOrder=t}return t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t}();t.Renderer=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,0,null)||this}return __extends(e,t),e.prototype.render=function(t){var e=this.camera?this.camera:t.camera;this.beginRender(e);for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.Epsilon=1e-5,e.Rad2Deg=57.29578,e.Deg2Rad=.0174532924,e.PiOver2=Math.PI/2,e}();t.MathHelper=e}(es||(es={})),function(t){t.matrixPool=[];var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"m11",{get:function(){return this.a},set:function(t){this.a=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m12",{get:function(){return this.b},set:function(t){this.b=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m21",{get:function(){return this.c},set:function(t){this.c=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m22",{get:function(){return this.d},set:function(t){this.d=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m31",{get:function(){return this.tx},set:function(t){this.tx=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m32",{get:function(){return this.ty},set:function(t){this.ty=t},enumerable:!0,configurable:!0}),i.create=function(){var e=t.matrixPool.pop();return e||(e=new i),e},i.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return 1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e),this},i.prototype.rotate=function(t){if(0!==(t=+t)){t/=DEG_TO_RAD;var e=Math.cos(t),i=Math.sin(t),n=this.a,r=this.b,o=this.c,s=this.d,a=this.tx,c=this.ty;this.a=n*e-r*i,this.b=n*i+r*e,this.c=o*e-s*i,this.d=o*i+s*e,this.tx=a*e-c*i,this.ty=a*i+c*e}return this},i.prototype.invert=function(){return this.$invertInto(this),this},i.prototype.add=function(t){return this.m11+=t.m11,this.m12+=t.m12,this.m21+=t.m21,this.m22+=t.m22,this.m31+=t.m31,this.m32+=t.m32,this},i.prototype.substract=function(t){return this.m11-=t.m11,this.m12-=t.m12,this.m21-=t.m21,this.m22-=t.m22,this.m31-=t.m31,this.m32-=t.m32,this},i.prototype.divide=function(t){return this.m11/=t.m11,this.m12/=t.m12,this.m21/=t.m21,this.m22/=t.m22,this.m31/=t.m31,this.m32/=t.m32,this},i.prototype.multiply=function(t){var e=this.m11*t.m11+this.m12*t.m21,i=this.m11*t.m12+this.m12*t.m22,n=this.m21*t.m11+this.m22*t.m21,r=this.m21*t.m12+this.m22*t.m22,o=this.m31*t.m11+this.m32*t.m21+t.m31,s=this.m31*t.m12+this.m32*t.m22+t.m32;return this.m11=e,this.m12=i,this.m21=n,this.m22=r,this.m31=o,this.m32=s,this},i.prototype.determinant=function(){return this.m11*this.m22-this.m12*this.m21},i.prototype.release=function(e){e&&t.matrixPool.push(e)},i}(egret.Matrix);t.Matrix2D=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"max",{get:function(){return new t.Vector2(this.right,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"center",{get:function(){return new t.Vector2(this.x+this.width/2,this.y+this.height/2)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return new t.Vector2(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){return new t.Vector2(this.width,this.height)},set:function(t){this.width=t.x,this.height=t.y},enumerable:!0,configurable:!0}),i.fromMinMax=function(t,e,n,r){return new i(t,e,n-t,r-e)},i.rectEncompassingPoints=function(t){for(var e=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=0;on&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return e}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if((e=Math.max(r,e))>(i=Math.min(o,i)))return e}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return e}else{var a=1/t.direction.y,c=(this.y-t.start.y)*a,h=(this.y+this.height-t.start.y)*a;if(c>h){var u=c;c=h,h=u}if((e=Math.max(c,e))>(i=Math.max(h,i)))return e}return e},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var u=(c.x*o.y-c.y*o.x)/a;return!(u<0||u>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),c=s.x*a.y-s.y*a.x;if(0==c)return o;var h=t.Vector2.subtract(n,e),u=(h.x*a.y-h.y*a.x)/c;if(u<0||u>1)return o;var l=(h.x*s.y-h.y*s.x)/c;return l<0||l>1?o:o=t.Vector2.add(e,new t.Vector2(u*s.x,u*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.isCircleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.isCircleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.clone=function(){return ObjectUtils.clone(this)},t}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);o=t.Vector2.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n=Number.MAX_VALUE,r=new t.Vector2(0,0);for(var o,s=new t.Vector2(0,0),a=0;ae.y!=this.points[r].y>e.y&&e.x<(this.points[r].x-this.points[n].x)*(e.y-this.points[n].y)/(this.points[r].y-this.points[n].y)+this.points[n].x&&(i=!i);return i},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return s;var a,c=t.Vector2.add(o.start,t.Vector2.add(o.direction,new t.Vector2(s))),h=0;c.xi.bounds.right&&(h|=1),c.yi.bounds.bottom&&(h|=2);var u=a+h;return 3==u&&console.log("m == 3. corner "+t.Time.frameCount),s},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,c=Number.POSITIVE_INFINITY,h=new t.Vector2,u=t.Vector2.subtract(e.position,i.position),l=0;l0&&(o=!1),!o)return!1;(g=Math.abs(g))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,0,n.normal),a=i.containsPoint(e.position);if(0>e.radius*e.radius&&!a)return!1;a?r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(0)-e.radius)):r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));return n.minimumTranslationVector=r,n.point=t.Vector2.add(s,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,n.normal=t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var l=(h.x*s.y-h.y*s.x)/c;return!(l<0||l>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(u),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),c=t.Vector2.dot(a,s),h=t.Vector2.dot(a,a)-n.radius*n.radius;if(h>0&&c>0)return!1;var u=c*c-h;return!(u<0)&&(r.fraction=-c-Math.sqrt(u),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal=r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),c=o.rayIntersects(a);return c<=1&&(r.fraction=c,r.distance=n.length()*c,r.normal=new t.Vector2(-n.x),r.normal=r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(c))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var c=this.cellAtPosition(s,a);if(c)for(var h=function(r){var o=c[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer))return"continue";e.intersects(o.bounds)&&(u._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||u._tempHashSet.push(o))},u=this,l=0;l=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.length-1;e>=0;e--)if(this.tilesets[e].firstGid<=t)return this.tilesets[e];console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers[t]},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){this.shape=new egret.Shape,this.textField=new egret.TextField}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=egret.Bitmap,i=function(){function i(){}return i.loadTmxMap=function(t,e){var i=RES.getRes(e);return this.loadTmxMapData(t,i)},i.loadTmxMapData=function(e,i){return __awaiter(this,void 0,void 0,function(){var n,r,o,s;return __generator(this,function(a){switch(a.label){case 0:e.version=i.version,e.tiledVersion=i.tiledversion,e.width=i.width,e.height=i.height,e.tileWidth=i.tilewidth,e.tileHeight=i.tileheight,e.hexSideLength=i.hexsidelength,e.orientation=this.parseOrientationType(i.orientation),e.staggerAxis=this.parseStaggerAxisType(i.staggeraxis),e.staggerIndex=this.parseStaggerIndexType(i.staggerindex),e.renderOrder=this.parseRenderOrderType(i.renderorder),e.nextObjectID=i.nextobjectid,e.backgroundColor=t.TmxUtils.color16ToUnit(i.color),e.properties=this.parsePropertyDict(i.properties),e.maxTileWidth=e.tileWidth,e.maxTileHeight=e.tileHeight,e.tilesets=[],n=0,r=i.tilesets,a.label=1;case 1:return nt.map.maxTileWidth&&(t.map.maxTileWidth=e.image.width),e.image.height>t.map.maxTileHeight&&(t.map.maxTileHeight=e.image.height))}),t.tileRegions.forEach(function(e){var i=e.width,n=e.height;i>t.map.maxTileWidth&&(t.map.maxTileWidth=i),i>t.map.maxTileHeight&&(t.map.maxTileHeight=n)})},i.parseOrientationType=function(e){return"unknown"==e?t.OrientationType.unknown:"orthogonal"==e?t.OrientationType.orthogonal:"isometric"==e?t.OrientationType.isometric:"staggered"==e?t.OrientationType.staggered:"hexagonal"==e?t.OrientationType.hexagonal:t.OrientationType.unknown},i.parseStaggerAxisType=function(e){return"y"==e?t.StaggerAxisType.y:t.StaggerAxisType.x},i.parseStaggerIndexType=function(e){return"even"==e?t.StaggerIndexType.even:t.StaggerIndexType.odd},i.parseRenderOrderType=function(e){return"right-up"==e?t.RenderOrderType.rightUp:"left-down"==e?t.RenderOrderType.leftDown:"left-up"==e?t.RenderOrderType.leftUp:t.RenderOrderType.rightDown},i.parsePropertyDict=function(t){if(!t)return null;for(var e=new Map,i=0,n=t.property;i=e.columns));y+=e.tileWidth+e.spacing);else e.tiles.forEach(function(i){e.tileRegions.set(r+i.id,new t.Rectangle(0,0,i.image.width,i.image.height))});return[2,e]}})})},i.loadTmxTilesetTile=function(e,i,n,r){return __awaiter(this,void 0,void 0,function(){var r,o,s,a,c,h,u;return __generator(this,function(l){switch(l.label){case 0:return e.tileset=i,e.id=n.id,e.terrainEdges=n.terrain,e.probability=null!=n.probability?n.probability:1,e.type=n.type,(r=n.image)?(o=e,[4,this.loadTmxImage(new t.TmxImage,r)]):[3,2];case 1:o.image=l.sent(),l.label=2;case 2:if(e.objectGroups=[],n.objectgroup)for(s=0,a=n.objectgroup;s0&&(h=u.currentAnimationFrameGid);var l=e.tileset.tileRegions.get(h),p=e.x*o,d=e.y*s,f=0;e.diagonalFlip&&(e.horizontalFlip&&e.verticalFlip?(f=t.MathHelper.PiOver2,p+=s+(l.height*r.y-s),d-=l.width*r.x-o):e.horizontalFlip?(f=-t.MathHelper.PiOver2,d+=s):e.verticalFlip?(f=t.MathHelper.PiOver2,p+=o+(l.height*r.y-s),d+=o-l.width*r.x):(f=-t.MathHelper.PiOver2,d+=s)),0==f&&(d+=s-l.height*r.y);var m=new t.Vector2(p,d).add(n);e.tileset.image?(e.tilesetTile.image.bitmap.parent||i.addChild(e.tilesetTile.image.bitmap),e.tilesetTile.image.bitmap.x=m.x,e.tilesetTile.image.bitmap.y=m.y,e.tilesetTile.image.bitmap.scaleX=r.x,e.tilesetTile.image.bitmap.scaleY=r.y,e.tilesetTile.image.bitmap.rotation=f,e.tilesetTile.image.bitmap.filters=[a]):(u.image.bitmap||i.addChild(u.image.bitmap),u.image.bitmap.x=m.x,u.image.bitmap.y=m.y,u.image.bitmap.scaleX=r.x,u.image.bitmap.scaleY=r.y,u.image.bitmap.rotation=f,u.image.bitmap.filters=[a])},e}();t.TiledRendering=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={})),function(t){var e=function(){function e(){}return e.decode=function(e,i,n){n=n||"none",i=i||"none";var r=e.children[0].text;switch(i){case"base64":var o=t.Base64Utils.decodeBase64AsArray(r,4);return"none"===n?o:t.Base64Utils.decompress(r,o,n);case"csv":return t.Base64Utils.decodeCSV(r);case"none":for(var s=[],a=0;ai;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}();!function(t){var e=function(){function t(){}return Object.defineProperty(t,"nativeBase64",{get:function(){return"function"==typeof window.atob},enumerable:!0,configurable:!0}),t.decode=function(t){if(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),this.nativeBase64)return window.atob(t);for(var e,i,n,r,o,s,a=[],c=0;c>4,i=(15&r)<<4|(o=this._keyStr.indexOf(t.charAt(c++)))>>2,n=(3&o)<<6|(s=this._keyStr.indexOf(t.charAt(c++))),a.push(String.fromCharCode(e)),64!==o&&a.push(String.fromCharCode(i)),64!==s&&a.push(String.fromCharCode(n));return a=a.join("")},t.encode=function(t){if(t=t.replace(/\r\n/g,"\n"),!this.nativeBase64){for(var e,i,n,r,o,s,a,c=[],h=0;h>2,o=(3&e)<<4|(i=t.charCodeAt(h++))>>4,s=(15&i)<<2|(n=t.charCodeAt(h++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),c.push(this._keyStr.charAt(r)),c.push(this._keyStr.charAt(o)),c.push(this._keyStr.charAt(s)),c.push(this._keyStr.charAt(a));return c=c.join("")}window.btoa(t)},t.decodeBase64AsArray=function(e,i){i=i||1;var n,r,o,s=t.decode(e),a=new Uint32Array(s.length/i);for(n=0,o=s.length/i;n=0;--r)a[n]+=s.charCodeAt(n*i+r)<<(r<<3);return a},t.decompress=function(t,e,i){throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!")},t.decodeCSV=function(t){for(var e=t.replace("\n","").trim().split(","),i=[],n=0;n>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){t.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function e(){}return e.drawLine=function(e,i,n,r,o){void 0===o&&(o=1),this.drawLineAngle(e,i,t.MathHelper.angleBetweenVectors(i,n),t.Vector2.distance(i,n),r,o)},e.drawCircle=function(t,e,i,n){t.graphics.beginFill(n),t.graphics.drawCircle(e.x,e.y,i),t.graphics.endFill()},e.drawPoints=function(e,i,n,r,o,s){if(void 0===o&&(o=!0),void 0===s&&(s=1),!(n.length<2)){for(var a=1;a=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function e(){this.x=0,this.y=0,this.touchPoint=-1,this.touchDown=!1}return Object.defineProperty(e.prototype,"position",{get:function(){return new t.Vector2(this.x,this.y)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.x=0,this.y=0,this.touchDown=!1,this.touchPoint=-1},e}();t.TouchState=e;var i=function(){function i(){}return Object.defineProperty(i,"gameTouchs",{get:function(){return this._gameTouchs},enumerable:!0,configurable:!0}),Object.defineProperty(i,"resolutionScale",{get:function(){return this._resolutionScale},enumerable:!0,configurable:!0}),Object.defineProperty(i,"totalTouchCount",{get:function(){return this._totalTouchCount},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPosition",{get:function(){return this._gameTouchs[0]?this._gameTouchs[0].position:t.Vector2.zero},enumerable:!0,configurable:!0}),Object.defineProperty(i,"maxSupportedTouch",{get:function(){return t.Core._instance.stage.maxTouches},set:function(e){t.Core._instance.stage.maxTouches=e,this.initTouchCache()},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPositionDelta",{get:function(){var e=t.Vector2.subtract(this.touchPosition,this._previousTouchState.position);return e.length()>0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.scaledPosition=function(e){var i=new t.Vector2(e.x-this._resolutionOffset.x,e.y-this._resolutionOffset.y);return t.Vector2.multiply(i,this.resolutionScale)},i.initTouchCache=function(){this._totalTouchCount=0,this._touchIndex=0,this._gameTouchs.length=0;for(var t=0;t0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={}));var THREAD_ID=Math.floor(1e3*Math.random())+"-"+Date.now(),nextTick=function(t){setTimeout(t,0)},LockUtils=function(){function t(t){this._keyX="mutex_key_"+t+"_X",this._keyY="mutex_key_"+t+"_Y",this.setItem=egret.localStorage.setItem.bind(localStorage),this.getItem=egret.localStorage.getItem.bind(localStorage),this.removeItem=egret.localStorage.removeItem.bind(localStorage)}return t.prototype.lock=function(){var t=this;return new Promise(function(e,i){var n=function(){t.setItem(t._keyX,THREAD_ID),null===!t.getItem(t._keyY)&&nextTick(n),t.setItem(t._keyY,THREAD_ID),t.getItem(t._keyX)!==THREAD_ID?setTimeout(function(){t.getItem(t._keyY)===THREAD_ID?(e(),t.removeItem(t._keyY)):nextTick(n)},10):(e(),t.removeItem(t._keyY))};n()})},t}();!function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,c=i[this._triPrev[s]],h=i[s],u=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(c,h,u)){var l=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[l],c,h,u)){a=!1;break}l=this._triNext[l]}while(l!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e=t.Vector2.divide(e,new t.Vector2(i)):e.x=e.y=0,e},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this._frameKey="frame",this._logKey="log",this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[r].snapMin=l.logs[r].min,l.logs[r].snapMax=l.logs[r].max,l.logs[r].snapAvg=l.logs[r].avg,l.logs[r].samples=0)):(l.logs[r].min=h,l.logs[r].max=h,l.logs[r].avg=h,l.logs[r].initialized=!0)}s.markCount=o.nestCount,s.nestCount=o.nestCount}t.stopwacth.reset(),t.stopwacth.start()}})},e.prototype.beginMark=function(t,i,n){var r=this;void 0===n&&(n=0),new LockUtils(this._frameKey).lock().then(function(){if(n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var o=r._curLog.bars[n];if(o.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(o.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var s=r._markerNameToIdMap.get(t);isNaN(s)&&(s=r.markers.length,r._markerNameToIdMap.set(t,s)),o.markerNests[o.nestCount++]=o.markCount,o.markers[o.markCount].markerId=s,o.markers[o.markCount].color=i,o.markers[o.markCount].beginTime=r.stopwacth.getTime(),o.markers[o.markCount].endTime=-1})},e.prototype.endMark=function(t,i){var n=this;void 0===i&&(i=0),new LockUtils(this._frameKey).lock().then(function(){if(i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var r=n._curLog.bars[i];if(r.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var o=n._markerNameToIdMap.get(t);if(isNaN(o))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var s=r.markerNests[--r.nestCount];if(r.markers[s].markerId!=o)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");r.markers[s].endTime=n.stopwacth.getTime()})},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){var t=this;new LockUtils(this._logKey).lock().then(function(){var e=parseInt(egret.localStorage.getItem(t._logKey),10);e+=1,egret.localStorage.setItem(t._logKey,e.toString()),t.markers.forEach(function(t){for(var e=0;e0&&(n+=e.barHeight+2*e.barPadding,r=Math.max(r,t.markers[t.markCount-1].endTime))});var o=this.sampleFrames*(1/60*1e3);this._frameAdjust=r>o?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,r/(1/60*1e3)+1),this._frameAdjust=0);t.y,e.barHeight}},e.prototype.onGraphicsDeviceReset=function(){var i=new t.Layout;this._position=i.place(new t.Vector2(this.width,e.barHeight),0,.01,t.Alignment.bottomCenter).location},e.maxBars=8,e.maxSamples=256,e.maxNestCall=32,e.barHeight=8,e.maxSampleFrames=4,e.logSnapDuration=120,e.barPadding=2,e.autoAdjustDelay=30,e}();t.TimeRuler=e;var i=function(){return function(){this.bars=new Array(e.maxBars),this.bars.fill(new n,0,e.maxBars)}}();t.FrameLog=i;var n=function(){return function(){this.markers=new Array(e.maxSamples),this.markCount=0,this.markerNests=new Array(e.maxNestCall),this.nestCount=0,this.markers.fill(new r,0,e.maxSamples),this.markerNests.fill(0,0,e.maxNestCall)}}();t.MarkerCollection=n;var r=function(){return function(){this.markerId=0,this.beginTime=0,this.endTime=0,this.color=0}}();t.Marker=r;var o=function(){return function(t){this.logs=new Array(e.maxBars),this.name=t,this.logs.fill(new s,0,e.maxBars)}}();t.MarkerInfo=o;var s=function(){return function(){this.snapMin=0,this.snapMax=0,this.snapAvg=0,this.min=0,this.max=0,this.avg=0,this.samples=0,this.color=0,this.initialized=!1}}();t.MarkerLog=s}(es||(es={})); \ No newline at end of file diff --git a/demo/resource/assets/isometric_grass_and_water.json b/demo/resource/assets/isometric_grass_and_water.json new file mode 100644 index 00000000..aeb0d798 --- /dev/null +++ b/demo/resource/assets/isometric_grass_and_water.json @@ -0,0 +1,345 @@ +{ "height":25, + "infinite":false, + "layers":[ + { + "data":[24, 24, 23, 11, 19, 19, 12, 23, 24, 24, 23, 7, 2, 2, 1, 4, 2, 2, 3, 4, 4, 1, 3, 4, 1, 24, 23, 23, 14, 3, 3, 8, 12, 24, 24, 18, 4, 1, 3, 1, 3, 3, 4, 4, 1, 3, 1, 4, 3, 4, 11, 15, 15, 7, 1, 4, 3, 20, 23, 11, 7, 2, 1, 3, 1, 3, 4, 4, 3, 2, 2, 3, 4, 2, 1, 18, 4, 3, 2, 2, 4, 3, 8, 12, 18, 2, 4, 4, 3, 3, 1, 4, 2, 1, 4, 4, 4, 1, 1, 1, 14, 2, 1, 4, 2, 1, 4, 2, 8, 7, 5, 17, 6, 3, 3, 3, 4, 3, 4, 4, 3, 2, 4, 3, 4, 10, 6, 2, 1, 4, 4, 1, 3, 4, 3, 8, 12, 10, 6, 2, 1, 1, 1, 1, 2, 1, 4, 2, 1, 1, 24, 18, 1, 2, 4, 3, 3, 5, 6, 5, 13, 9, 11, 7, 3, 4, 1, 3, 1, 3, 4, 2, 4, 4, 4, 24, 14, 4, 2, 5, 6, 2, 8, 22, 9, 23, 24, 10, 6, 2, 1, 3, 1, 5, 6, 2, 3, 4, 4, 2, 19, 7, 3, 1, 8, 7, 4, 1, 8, 12, 24, 23, 23, 10, 17, 6, 3, 1, 8, 7, 1, 3, 3, 3, 1, 1, 2, 4, 2, 2, 3, 3, 4, 3, 20, 24, 23, 23, 23, 23, 18, 2, 2, 3, 1, 4, 4, 1, 1, 1, 3, 3, 5, 13, 6, 1, 2, 2, 5, 9, 23, 23, 24, 23, 24, 14, 1, 3, 1, 1, 3, 3, 4, 4, 4, 2, 4, 16, 24, 10, 6, 2, 4, 20, 23, 23, 24, 23, 23, 24, 14, 2, 4, 2, 4, 5, 6, 4, 3, 1, 3, 1, 20, 23, 24, 10, 6, 3, 8, 12, 24, 23, 23, 23, 24, 14, 1, 2, 1, 5, 9, 18, 4, 3, 4, 4, 2, 8, 12, 23, 24, 18, 4, 3, 16, 24, 24, 24, 23, 24, 18, 1, 3, 1, 16, 24, 14, 1, 3, 2, 4, 1, 2, 8, 12, 24, 14, 4, 1, 8, 15, 12, 24, 23, 11, 7, 2, 1, 2, 16, 23, 18, 1, 4, 2, 3, 4, 3, 2, 8, 19, 7, 2, 2, 3, 3, 8, 15, 19, 7, 3, 1, 2, 5, 9, 24, 14, 1, 2, 3, 2, 2, 1, 4, 4, 1, 2, 5, 6, 2, 2, 2, 1, 3, 4, 3, 5, 13, 9, 24, 24, 18, 4, 3, 4, 1, 4, 1, 3, 2, 5, 13, 9, 14, 3, 1, 3, 2, 4, 4, 5, 21, 19, 12, 24, 11, 7, 1, 2, 3, 2, 1, 3, 3, 3, 20, 23, 24, 18, 4, 4, 2, 3, 1, 1, 8, 7, 5, 9, 23, 18, 1, 3, 4, 2, 4, 2, 4, 1, 2, 8, 15, 19, 7, 4, 5, 6, 4, 2, 4, 5, 17, 9, 23, 11, 22, 13, 6, 4, 1, 3, 2, 2, 4, 4, 3, 2, 1, 4, 2, 8, 7, 4, 2, 3, 16, 24, 23, 11, 7, 16, 23, 18, 3, 1, 1, 3, 1, 2, 3, 3, 3, 4, 2, 1, 3, 2, 3, 4, 3, 8, 15, 15, 7, 4, 8, 19, 7, 3, 4, 1, 2, 3, 4, 1, 3, 4, 4, 4, 1, 4, 4, 3, 2, 3, 4, 1, 2, 4, 2, 1, 2, 2, 4, 1, 4, 2, 3, 2, 1, 4, 2, 2, 1, 2, 2, 2, 4, 3, 3, 2, 3, 3, 2, 3, 2, 4, 1, 3, 1, 1, 1, 1, 4, 1, 3, 3, 2, 1, 4, 2, 1, 3, 1, 3, 3, 4, 3, 4, 2, 1, 2, 3, 1, 1], + "height":25, + "id":1, + "name":"Tile Layer 1", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":25, + "x":0, + "y":0 + }], + "nextlayerid":2, + "nextobjectid":1, + "orientation":"isometric", + "renderorder":"right-down", + "tiledversion":"1.2.1", + "tileheight":32, + "tilesets":[ + { + "columns":4, + "firstgid":1, + "grid": + { + "height":32, + "orientation":"isometric", + "width":64 + }, + "image":"isometric_grass_and_water.png", + "imageheight":384, + "imagewidth":256, + "margin":0, + "name":"isometric_grass_and_water", + "spacing":0, + "terrains":[ + { + "name":"Grass", + "tile":0 + }, + { + "name":"Water", + "tile":22 + }], + "tilecount":24, + "tileheight":64, + "tileoffset": + { + "x":0, + "y":16 + }, + "tiles":[ + { + "id":0, + "terrain":[0, 0, 0, 0] + }, + { + "id":1, + "terrain":[0, 0, 0, 0] + }, + { + "id":2, + "terrain":[0, 0, 0, 0] + }, + { + "id":3, + "terrain":[0, 0, 0, 0] + }, + { + "id":4, + "terrain":[0, 0, 0, 1] + }, + { + "id":5, + "terrain":[0, 0, 1, 0] + }, + { + "id":6, + "terrain":[1, 0, 0, 0] + }, + { + "id":7, + "terrain":[0, 1, 0, 0] + }, + { + "id":8, + "terrain":[0, 1, 1, 1] + }, + { + "id":9, + "terrain":[1, 0, 1, 1] + }, + { + "id":10, + "terrain":[1, 1, 1, 0] + }, + { + "id":11, + "terrain":[1, 1, 0, 1] + }, + { + "id":12, + "terrain":[0, 0, 1, 1] + }, + { + "id":13, + "terrain":[1, 0, 1, 0] + }, + { + "id":14, + "terrain":[1, 1, 0, 0] + }, + { + "id":15, + "terrain":[0, 1, 0, 1] + }, + { + "id":16, + "terrain":[0, 0, 1, 1] + }, + { + "id":17, + "terrain":[1, 0, 1, 0] + }, + { + "id":18, + "terrain":[1, 1, 0, 0] + }, + { + "id":19, + "terrain":[0, 1, 0, 1] + }, + { + "id":20, + "terrain":[0, 1, 1, 0] + }, + { + "id":21, + "terrain":[1, 0, 0, 1] + }, + { + "id":22, + "terrain":[1, 1, 1, 1] + }, + { + "id":23, + "terrain":[1, 1, 1, 1] + }], + "tilewidth":64, + "wangsets":[ + { + "cornercolors":[ + { + "color":"#8ab022", + "name":"Grass", + "probability":1, + "tile":0 + }, + { + "color":"#378dc2", + "name":"Water", + "probability":1, + "tile":23 + }], + "edgecolors":[], + "name":"Grass and Water", + "tile":15, + "wangtiles":[ + { + "dflip":false, + "hflip":false, + "tileid":0, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":1, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":2, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":3, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":4, + "vflip":false, + "wangid":[0, 1, 0, 2, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":5, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 2, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":6, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 1, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":7, + "vflip":false, + "wangid":[0, 2, 0, 1, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":8, + "vflip":false, + "wangid":[0, 2, 0, 2, 0, 2, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":9, + "vflip":false, + "wangid":[0, 1, 0, 2, 0, 2, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":10, + "vflip":false, + "wangid":[0, 2, 0, 1, 0, 2, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":11, + "vflip":false, + "wangid":[0, 2, 0, 2, 0, 1, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":12, + "vflip":false, + "wangid":[0, 1, 0, 2, 0, 2, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":13, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 2, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":14, + "vflip":false, + "wangid":[0, 2, 0, 1, 0, 1, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":15, + "vflip":false, + "wangid":[0, 2, 0, 2, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":16, + "vflip":false, + "wangid":[0, 1, 0, 2, 0, 2, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":17, + "vflip":false, + "wangid":[0, 1, 0, 1, 0, 2, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":18, + "vflip":false, + "wangid":[0, 2, 0, 1, 0, 1, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":19, + "vflip":false, + "wangid":[0, 2, 0, 2, 0, 1, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":20, + "vflip":false, + "wangid":[0, 2, 0, 1, 0, 2, 0, 1] + }, + { + "dflip":false, + "hflip":false, + "tileid":21, + "vflip":false, + "wangid":[0, 1, 0, 2, 0, 1, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":22, + "vflip":false, + "wangid":[0, 2, 0, 2, 0, 2, 0, 2] + }, + { + "dflip":false, + "hflip":false, + "tileid":23, + "vflip":false, + "wangid":[0, 2, 0, 2, 0, 2, 0, 2] + }] + }] + }], + "tilewidth":64, + "type":"map", + "version":1.2, + "width":25 +} \ No newline at end of file diff --git a/demo/resource/assets/isometric_grass_and_water.png b/demo/resource/assets/isometric_grass_and_water.png new file mode 100644 index 0000000000000000000000000000000000000000..b342a0cb43526605d06330c1c3613671e6bee2d2 GIT binary patch literal 104828 zcmV)fK&8KlP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igJz z6(a#zkaw~G03ZNKL_t(|+U&e}oFqqiCj3N1W>#ip-Bo>5-`#VMW=1m_&8f?hI0fPs z5(2y!Rv2u47y|~Q)oLsZKePUU@fxo`et6-tK5J#kvW1t$#$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zq$WC^e2BQptN}rn@m;C%)l=;O{(;IG&754@)pAN}>P4TWc4rOaaFtCcDo% zA%qtKd~C`^iG+*w<75W_ojVJ%8!X{r;5fkGG*c<6YHFe=Q~Uki5HfuO`TI07t%5J` zzH=KDVvD1w&3g+wGd<6Wu|e*}V{7Hl2XE*8|3-Z8tr%T#< PxKCZ>g>sdWb;$n!QT)pc literal 0 HcmV?d00001 diff --git a/demo/resource/default.res.json b/demo/resource/default.res.json index 7faab154..042f4620 100644 --- a/demo/resource/default.res.json +++ b/demo/resource/default.res.json @@ -1,7 +1,7 @@ { "groups": [ { - "keys": "checkbox_select_disabled_png,checkbox_select_down_png,checkbox_select_up_png,checkbox_unselect_png,selected_png,border_png,header_png,radiobutton_select_disabled_png,radiobutton_select_down_png,radiobutton_select_up_png,radiobutton_unselect_png,roundthumb_png,thumb_png,track_png,tracklight_png,handle_png,off_png,on_png,button_down_png,button_up_png,thumb_pb_png,track_pb_png,track_sb_png,bg_jpg,egret_icon_png,description_json", + "keys": "checkbox_select_disabled_png,checkbox_select_down_png,checkbox_select_up_png,checkbox_unselect_png,selected_png,border_png,header_png,radiobutton_select_disabled_png,radiobutton_select_down_png,radiobutton_select_up_png,radiobutton_unselect_png,roundthumb_png,thumb_png,track_png,tracklight_png,handle_png,off_png,on_png,button_down_png,button_up_png,thumb_pb_png,track_pb_png,track_sb_png,bg_jpg,egret_icon_png,description_json,isometric_grass_and_water_json", "name": "preload" } ], diff --git a/demo/src/game/MainScene.ts b/demo/src/game/MainScene.ts index 9730d05d..625d27d7 100644 --- a/demo/src/game/MainScene.ts +++ b/demo/src/game/MainScene.ts @@ -31,6 +31,10 @@ module scene { // player2.addComponent(new es.BoxCollider()); } + let map = new es.TmxMap(); + let mapData = await es.TiledMapLoader.loadTmxMap(map, "isometric_grass_and_water_json"); + console.log(mapData); + let pool = new es.ComponentPool(component.SimplePooled); let c1 = pool.obtain(); diff --git a/source/bin/framework.d.ts b/source/bin/framework.d.ts index c98637a7..e5fa93f1 100644 --- a/source/bin/framework.d.ts +++ b/source/bin/framework.d.ts @@ -252,6 +252,7 @@ declare module es { declare module es { class Core extends egret.DisplayObjectContainer { static emitter: Emitter; + static debugRenderEndabled: boolean; static graphicsDevice: GraphicsDevice; static content: ContentManager; static _instance: Core; @@ -1551,11 +1552,11 @@ declare module es { properties: Map; visible: boolean; name: string; - layers: TmxList; - tileLayers: TmxList; - objectGroups: TmxList; - imageLayers: TmxList; - groups: TmxList; + layers: ITmxLayer[]; + tileLayers: TmxLayer[]; + objectGroups: TmxObjectGroup[]; + imageLayers: TmxImageLayer[]; + groups: TmxGroup[]; } } declare module es { @@ -1618,19 +1619,15 @@ declare module es { } declare module es { class TmxDocument { - TmxDirectory: string; + tmxDirectory: string; constructor(); } interface ITmxElement { name: string; } - class TmxList extends Map { - _nameCount: Map; - add(t: T): void; - protected getKeyForItem(item: T): string; - } class TmxImage { - texture: egret.Texture; + bitmap: egret.Bitmap; + readonly texture: egret.Texture; source: string; format: string; data: any; @@ -1657,12 +1654,12 @@ declare module es { renderOrder: RenderOrderType; backgroundColor: number; nextObjectID?: number; - layers: TmxList; - tilesets: TmxList; - tileLayers: TmxList; - objectGroups: TmxList; - imageLayers: TmxList; - groups: TmxList; + layers: ITmxLayer[]; + tilesets: TmxTileset[]; + tileLayers: TmxLayer[]; + objectGroups: TmxLayer[]; + imageLayers: TmxImageLayer[]; + groups: TmxGroup[]; properties: Map; maxTileWidth: number; maxTileHeight: number; @@ -1707,12 +1704,14 @@ declare module es { offsetY: number; color: number; drawOrder: DrawOrderType; - objects: TmxList; + objects: TmxObject[]; properties: Map; } class TmxObject implements ITmxElement { id: number; name: string; + shape: egret.Shape; + textField: egret.TextField; objectType: TmxObjectType; type: string; x: number; @@ -1725,6 +1724,7 @@ declare module es { text: TmxText; points: Vector2[]; properties: Map; + constructor(); } class TmxText { fontFamily: string; @@ -1769,14 +1769,40 @@ declare module es { bottom = 2 } } +declare module es { + class TiledMapLoader { + static loadTmxMap(map: TmxMap, filePath: string): Promise; + static loadTmxMapData(map: TmxMap, xMap: any): Promise; + static parseLayers(container: any, xEle: any, map: TmxMap, width: number, height: number, tmxDirectory: string): void; + private static updateMaxTileSizes; + static parseOrientationType(type: string): OrientationType; + static parseStaggerAxisType(type: string): StaggerAxisType; + static parseStaggerIndexType(type: string): StaggerIndexType; + static parseRenderOrderType(type: string): RenderOrderType; + static parsePropertyDict(prop: any): Map; + static parseTmxTileset(map: TmxMap, xTileset: any): Promise; + static loadTmxTileset(tileset: TmxTileset, map: TmxMap, xTileset: any, firstGid: number): Promise; + static loadTmxTilesetTile(tile: TmxTilesetTile, tileset: TmxTileset, xTile: any, terrains: TmxTerrain[]): Promise; + static loadTmxAnimationFrame(frame: TmxAnimationFrame, xFrame: any): TmxAnimationFrame; + static loadTmxObjectGroup(group: TmxObjectGroup, map: TmxMap, xObjectGroup: any): TmxObjectGroup; + static loadTmxObject(obj: TmxObject, map: TmxMap, xObject: any): TmxObject; + static loadTmxText(text: TmxText, xText: any): TmxText; + static loadTmxAlignment(alignment: TmxAlignment, xText: any): TmxAlignment; + static parsePoints(xPoints: any): any[]; + static parsePoint(s: string): Vector2; + static parseTmxTerrain(xTerrain: any): TmxTerrain; + static parseTmxTileOffset(xTileOffset: any): TmxTileOffset; + static loadTmxImage(image: TmxImage, xImage: any): Promise; + } +} declare module es { class TiledRendering { - static renderMap(map: TmxMap, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderLayer(layer: TmxLayer, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderImageLayer(layer: TmxImageLayer, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderObjectGroup(objGroup: TmxObjectGroup, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderGroup(group: TmxGroup, position: Vector2, scale: Vector2, layerDepth: number): void; - static renderTile(tile: TmxLayerTile, position: Vector2, scale: Vector2, tileWidth: number, tileHeight: number, color: Color, layerDepth: number): void; + static renderMap(map: TmxMap, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderLayer(layer: TmxLayer, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderImageLayer(layer: TmxImageLayer, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderObjectGroup(objGroup: TmxObjectGroup, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderGroup(group: TmxGroup, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number): void; + static renderTile(tile: TmxLayerTile, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, tileWidth: number, tileHeight: number, color: egret.ColorMatrixFilter, layerDepth: number): void; } } declare module es { @@ -1794,7 +1820,7 @@ declare module es { tileOffset: TmxTileOffset; properties: Map; image: TmxImage; - terrains: TmxList; + terrains: TmxTerrain[]; tileRegions: Map; update(): void; } @@ -1817,7 +1843,7 @@ declare module es { type: string; properties: Map; image: TmxImage; - objectGroups: TmxList; + objectGroups: TmxObjectGroup[]; animationFrames: TmxAnimationFrame[]; readonly currentAnimationFrameGid: number; _animationElapsedTime: number; @@ -1835,6 +1861,12 @@ declare module es { duration: number; } } +declare module es { + class TmxUtils { + static decode(data: any, encoding: any, compression: string): Array; + static color16ToUnit($color: string): number; + } +} declare class ArrayUtils { static bubbleSort(ary: number[]): void; static insertionSort(ary: number[]): void; @@ -1850,15 +1882,16 @@ declare class ArrayUtils { static equals(ary1: number[], ary2: number[]): Boolean; static insert(ary: any[], index: number, value: any): any; } -declare class Base64Utils { - private static _keyNum; - private static _keyStr; - private static _keyAll; - static encode: (input: any) => string; - static decode(input: any, isNotStr?: boolean): string; - private static _utf8_encode; - private static _utf8_decode; - private static getConfKey; +declare module es { + class Base64Utils { + private static _keyStr; + static readonly nativeBase64: boolean; + static decode(input: string): string; + static encode(input: string): string; + static decodeBase64AsArray(input: string, bytes: number): Uint32Array; + static decompress(data: string, decoded: any, compression: string): any; + static decodeCSV(input: string): Array; + } } declare module es { class Color { @@ -1882,6 +1915,9 @@ declare module es { declare module es { class DrawUtils { static drawLine(shape: egret.Shape, start: Vector2, end: Vector2, color: number, thickness?: number): void; + static drawCircle(shape: egret.Shape, position: Vector2, radius: number, color: number): void; + static drawPoints(shape: egret.Shape, position: Vector2, points: Vector2[], color: number, closePoly?: boolean, thickness?: number): void; + static drawString(textField: egret.TextField, text: string, position: Vector2, color: number, rotation: number, origin: Vector2, scale: number): void; static drawLineAngle(shape: egret.Shape, start: Vector2, radians: number, length: number, color: number, thickness?: number): void; static drawHollowRect(shape: egret.Shape, rect: Rectangle, color: number, thickness?: number): void; static drawHollowRectR(shape: egret.Shape, x: number, y: number, width: number, height: number, color: number, thickness?: number): void; diff --git a/source/bin/framework.js b/source/bin/framework.js index ff49d9b2..4aa21528 100644 --- a/source/bin/framework.js +++ b/source/bin/framework.js @@ -1284,6 +1284,7 @@ var es; es.Input.initialize(); this.initialize(); }; + Core.debugRenderEndabled = false; return Core; }(egret.DisplayObjectContainer)); es.Core = Core; @@ -3296,8 +3297,9 @@ var es; _this.physicsLayer = 1 << 0; _this.tiledMap = tiledMap; _this._shouldCreateColliders = shouldCreateColliders; + _this.displayObject = new egret.DisplayObjectContainer(); if (collisionLayerName) { - _this.collisionLayer = tiledMap.tileLayers.get(collisionLayerName); + _this.collisionLayer = tiledMap.tileLayers[collisionLayerName]; } return _this; } @@ -3333,7 +3335,7 @@ var es; var layerType = this.tiledMap.getLayer(layerName); for (var layer in this.tiledMap.layers) { if (this.tiledMap.layers.hasOwnProperty(layer) && - this.tiledMap.layers.get(layer) == layerType) { + this.tiledMap.layers[layer] == layerType) { return index; } } @@ -3364,12 +3366,12 @@ var es; }; TiledMapRenderer.prototype.render = function (camera) { if (!this.layerIndicesToRender) { - es.TiledRendering.renderMap(this.tiledMap, es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); + es.TiledRendering.renderMap(this.tiledMap, this.displayObject, es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); } else { - for (var i = 0; i < this.tiledMap.layers.size; i++) { - if (this.tiledMap.layers.get(i.toString()).visible && this.layerIndicesToRender.contains(i)) - es.TiledRendering.renderLayer(this.tiledMap.layers.get(i.toString()), es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); + for (var i = 0; i < this.tiledMap.layers.length; i++) { + if (this.tiledMap.layers[i].visible && this.layerIndicesToRender.contains(i)) + es.TiledRendering.renderLayer(this.tiledMap.layers[i], this.displayObject, es.Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); } } }; @@ -7606,45 +7608,25 @@ var es; (function (es) { var TmxDocument = (function () { function TmxDocument() { - this.TmxDirectory = ""; + this.tmxDirectory = ""; } return TmxDocument; }()); es.TmxDocument = TmxDocument; - var TmxList = (function (_super) { - __extends(TmxList, _super); - function TmxList() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this._nameCount = new Map(); - return _this; - } - TmxList.prototype.add = function (t) { - var tName = t.name; - if (this.has(tName)) - this._nameCount.set(tName, this._nameCount.get(tName) + 1); - else - this._nameCount.set(tName, 0); - }; - TmxList.prototype.getKeyForItem = function (item) { - var name = item.name; - var count = this._nameCount.get(name); - var dupes = 0; - while (this.has(name)) { - name = name + es.Enumerable.repeat("_", dupes).toString() + count.toString(); - dupes++; - } - return name; - }; - return TmxList; - }(Map)); - es.TmxList = TmxList; var TmxImage = (function () { function TmxImage() { } + Object.defineProperty(TmxImage.prototype, "texture", { + get: function () { + return this.bitmap.texture; + }, + enumerable: true, + configurable: true + }); TmxImage.prototype.dispose = function () { - if (this.texture) { + if (this.bitmap) { this.texture.dispose(); - this.texture = null; + this.bitmap = null; } }; return TmxImage; @@ -7682,9 +7664,9 @@ var es; TmxMap.prototype.getTilesetForTileGid = function (gid) { if (gid == 0) return null; - for (var i = this.tilesets.size - 1; i >= 0; i--) { - if (this.tilesets.get(i.toString()).firstGid <= gid) - return this.tilesets.get(i.toString()); + for (var i = this.tilesets.length - 1; i >= 0; i--) { + if (this.tilesets[i].firstGid <= gid) + return this.tilesets[i]; } console.error("tile gid" + gid + "\u672A\u5728\u4EFB\u4F55tileset\u4E2D\u627E\u5230"); }; @@ -7703,7 +7685,7 @@ var es; return es.MathHelper.clamp(tileY, 0, this.height - 1); }; TmxMap.prototype.getLayer = function (name) { - return this.layers.get(name); + return this.layers[name]; }; TmxMap.prototype.update = function () { this.tilesets.forEach(function (tileset) { tileset.update(); }); @@ -7759,6 +7741,8 @@ var es; es.TmxObjectGroup = TmxObjectGroup; var TmxObject = (function () { function TmxObject() { + this.shape = new egret.Shape(); + this.textField = new egret.TextField(); } return TmxObject; }()); @@ -7806,103 +7790,562 @@ var es; })(TmxVerticalAlignment = es.TmxVerticalAlignment || (es.TmxVerticalAlignment = {})); })(es || (es = {})); var es; +(function (es) { + var Bitmap = egret.Bitmap; + var TiledMapLoader = (function () { + function TiledMapLoader() { + } + TiledMapLoader.loadTmxMap = function (map, filePath) { + var xMap = RES.getRes(filePath); + return this.loadTmxMapData(map, xMap); + }; + TiledMapLoader.loadTmxMapData = function (map, xMap) { + return __awaiter(this, void 0, void 0, function () { + var _i, _a, e, tileset; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + map.version = xMap["version"]; + map.tiledVersion = xMap["tiledversion"]; + map.width = xMap["width"]; + map.height = xMap["height"]; + map.tileWidth = xMap["tilewidth"]; + map.tileHeight = xMap["tileheight"]; + map.hexSideLength = xMap["hexsidelength"]; + map.orientation = this.parseOrientationType(xMap["orientation"]); + map.staggerAxis = this.parseStaggerAxisType(xMap["staggeraxis"]); + map.staggerIndex = this.parseStaggerIndexType(xMap["staggerindex"]); + map.renderOrder = this.parseRenderOrderType(xMap["renderorder"]); + map.nextObjectID = xMap["nextobjectid"]; + map.backgroundColor = es.TmxUtils.color16ToUnit(xMap["color"]); + map.properties = this.parsePropertyDict(xMap["properties"]); + map.maxTileWidth = map.tileWidth; + map.maxTileHeight = map.tileHeight; + map.tilesets = []; + _i = 0, _a = xMap["tilesets"]; + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + e = _a[_i]; + return [4, this.parseTmxTileset(map, e)]; + case 2: + tileset = _b.sent(); + map.tilesets.push(tileset); + this.updateMaxTileSizes(tileset); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: + map.layers = []; + map.tileLayers = []; + map.objectGroups = []; + map.imageLayers = []; + map.groups = []; + this.parseLayers(map, xMap, map, map.width, map.height, map.tmxDirectory); + return [2, map]; + } + }); + }); + }; + TiledMapLoader.parseLayers = function (container, xEle, map, width, height, tmxDirectory) { + }; + TiledMapLoader.updateMaxTileSizes = function (tileset) { + tileset.tiles.forEach(function (tile) { + if (tile.image) { + if (tile.image.width > tileset.map.maxTileWidth) + tileset.map.maxTileWidth = tile.image.width; + if (tile.image.height > tileset.map.maxTileHeight) + tileset.map.maxTileHeight = tile.image.height; + } + }); + tileset.tileRegions.forEach(function (region) { + var width = region.width; + var height = region.height; + if (width > tileset.map.maxTileWidth) + tileset.map.maxTileWidth = width; + if (width > tileset.map.maxTileHeight) + tileset.map.maxTileHeight = height; + }); + }; + TiledMapLoader.parseOrientationType = function (type) { + if (type == "unknown") + return es.OrientationType.unknown; + if (type == "orthogonal") + return es.OrientationType.orthogonal; + if (type == "isometric") + return es.OrientationType.isometric; + if (type == "staggered") + return es.OrientationType.staggered; + if (type == "hexagonal") + return es.OrientationType.hexagonal; + return es.OrientationType.unknown; + }; + TiledMapLoader.parseStaggerAxisType = function (type) { + if (type == "y") + return es.StaggerAxisType.y; + return es.StaggerAxisType.x; + }; + TiledMapLoader.parseStaggerIndexType = function (type) { + if (type == "even") + return es.StaggerIndexType.even; + return es.StaggerIndexType.odd; + }; + TiledMapLoader.parseRenderOrderType = function (type) { + if (type == "right-up") + return es.RenderOrderType.rightUp; + if (type == "left-down") + return es.RenderOrderType.leftDown; + if (type == "left-up") + return es.RenderOrderType.leftUp; + return es.RenderOrderType.rightDown; + }; + TiledMapLoader.parsePropertyDict = function (prop) { + if (!prop) + return null; + var dict = new Map(); + for (var _i = 0, _a = prop["property"]; _i < _a.length; _i++) { + var p = _a[_i]; + var pname = p["name"]; + var valueAttr = p["value"]; + var pval = valueAttr ? valueAttr : p; + dict.set(pname, pval); + } + return dict; + }; + TiledMapLoader.parseTmxTileset = function (map, xTileset) { + return __awaiter(this, void 0, void 0, function () { + var xFirstGid, firstGid, source, xDocTileset, tileset; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + xFirstGid = xTileset["firstgid"]; + firstGid = xFirstGid; + source = xTileset["image"]; + if (!!source) return [3, 2]; + source = "resource/assets/" + source; + return [4, RES.getResByUrl(source, null, this, RES.ResourceItem.TYPE_IMAGE)]; + case 1: + xDocTileset = _a.sent(); + tileset = this.loadTmxTileset(new es.TmxTileset(), map, xDocTileset["tileset"], firstGid); + return [2, tileset]; + case 2: return [2, this.loadTmxTileset(new es.TmxTileset(), map, xTileset, firstGid)]; + } + }); + }); + }; + TiledMapLoader.loadTmxTileset = function (tileset, map, xTileset, firstGid) { + return __awaiter(this, void 0, void 0, function () { + var xImage, _a, xTerrainType, _i, _b, e, _c, _d, xTile, tile, id, y, column, x; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + tileset.map = map; + tileset.firstGid = firstGid; + tileset.name = xTileset["name"]; + tileset.tileWidth = xTileset["tilewidth"]; + tileset.tileHeight = xTileset["tileheight"]; + tileset.spacing = xTileset["spacing"] != undefined ? xTileset["spacing"] : 0; + tileset.margin = xTileset["margin"] != undefined ? xTileset["margin"] : 0; + tileset.columns = xTileset["columns"]; + tileset.tileCount = xTileset["tilecount"]; + tileset.tileOffset = this.parseTmxTileOffset(xTileset["tileoffset"]); + xImage = xTileset["image"]; + if (!xImage) return [3, 2]; + _a = tileset; + return [4, this.loadTmxImage(new es.TmxImage(), xTileset)]; + case 1: + _a.image = _e.sent(); + _e.label = 2; + case 2: + xTerrainType = xTileset["terraintypes"]; + if (xTerrainType) { + tileset.terrains = []; + for (_i = 0, _b = xTerrainType["terrains"]; _i < _b.length; _i++) { + e = _b[_i]; + tileset.terrains.push(this.parseTmxTerrain(e)); + } + } + tileset.tiles = new Map(); + _c = 0, _d = xTileset["tiles"]; + _e.label = 3; + case 3: + if (!(_c < _d.length)) return [3, 6]; + xTile = _d[_c]; + return [4, this.loadTmxTilesetTile(new es.TmxTilesetTile(), tileset, xTile, tileset.terrains)]; + case 4: + tile = _e.sent(); + tileset.tiles[tile.id] = tile; + _e.label = 5; + case 5: + _c++; + return [3, 3]; + case 6: + tileset.properties = this.parsePropertyDict(xTileset["properties"]); + tileset.tileRegions = new Map(); + if (tileset.image) { + id = firstGid; + for (y = tileset.margin; y < tileset.image.height - tileset.margin; y += tileset.tileHeight + tileset.spacing) { + column = 0; + for (x = tileset.margin; x < tileset.image.width - tileset.margin; x += tileset.tileWidth + tileset.spacing) { + tileset.tileRegions.set(id++, new es.Rectangle(x, y, tileset.tileWidth, tileset.tileHeight)); + if (++column >= tileset.columns) + break; + } + } + } + else { + tileset.tiles.forEach(function (tile) { + tileset.tileRegions.set(firstGid + tile.id, new es.Rectangle(0, 0, tile.image.width, tile.image.height)); + }); + } + return [2, tileset]; + } + }); + }); + }; + TiledMapLoader.loadTmxTilesetTile = function (tile, tileset, xTile, terrains) { + return __awaiter(this, void 0, void 0, function () { + var xImage, _a, _i, _b, e, _c, _d, e; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + tile.tileset = tileset; + tile.id = xTile["id"]; + tile.terrainEdges = xTile["terrain"]; + tile.probability = xTile["probability"] != undefined ? xTile["probability"] : 1; + tile.type = xTile["type"]; + xImage = xTile["image"]; + if (!xImage) return [3, 2]; + _a = tile; + return [4, this.loadTmxImage(new es.TmxImage(), xImage)]; + case 1: + _a.image = _e.sent(); + _e.label = 2; + case 2: + tile.objectGroups = []; + if (xTile["objectgroup"]) + for (_i = 0, _b = xTile["objectgroup"]; _i < _b.length; _i++) { + e = _b[_i]; + tile.objectGroups.push(this.loadTmxObjectGroup(new es.TmxObjectGroup(), tileset.map, e)); + } + tile.animationFrames = []; + if (xTile["animation"]) { + for (_c = 0, _d = xTile["animation"]["frame"]; _c < _d.length; _c++) { + e = _d[_c]; + tile.animationFrames.push(this.loadTmxAnimationFrame(new es.TmxAnimationFrame(), e)); + } + } + tile.properties = this.parsePropertyDict(xTile["properties"]); + if (tile.properties) + tile.processProperties(); + return [2, tile]; + } + }); + }); + }; + TiledMapLoader.loadTmxAnimationFrame = function (frame, xFrame) { + frame.gid = xFrame["tileid"]; + frame.duration = xFrame["duration"] / 1000; + return frame; + }; + TiledMapLoader.loadTmxObjectGroup = function (group, map, xObjectGroup) { + group.map = map; + group.name = xObjectGroup["name"] != undefined ? xObjectGroup["name"] : ""; + group.color = es.TmxUtils.color16ToUnit(xObjectGroup["color"]); + group.opacity = xObjectGroup["opacity"] != undefined ? xObjectGroup["opacity"] : 1; + group.visible = xObjectGroup["visible"] != undefined ? xObjectGroup["visible"] : true; + group.offsetX = xObjectGroup["offsetx"] != undefined ? xObjectGroup["offsetx"] : 0; + group.offsetY = xObjectGroup["offsety"] != undefined ? xObjectGroup["offsety"] : 0; + var drawOrderDict = new Map(); + drawOrderDict.set("unknown", es.DrawOrderType.unkownOrder); + drawOrderDict.set("topdown", es.DrawOrderType.IndexOrder); + drawOrderDict.set("index", es.DrawOrderType.TopDown); + var drawOrderValue = xObjectGroup["draworder"]; + if (drawOrderValue) + group.drawOrder = drawOrderDict[drawOrderValue]; + group.objects = []; + for (var _i = 0, _a = xObjectGroup["object"]; _i < _a.length; _i++) { + var e = _a[_i]; + group.objects.push(this.loadTmxObject(new es.TmxObject(), map, e)); + } + group.properties = this.parsePropertyDict(xObjectGroup["properties"]); + return group; + }; + TiledMapLoader.loadTmxObject = function (obj, map, xObject) { + obj.id = xObject["id"] != undefined ? xObject["id"] : 0; + obj.name = xObject["name"] != undefined ? xObject["name"] : ""; + obj.x = xObject["x"]; + obj.y = xObject["y"]; + obj.width = xObject["width"] != undefined ? xObject["width"] : 0; + obj.height = xObject["height"] != undefined ? xObject["height"] : 0; + obj.type = xObject["type"] != undefined ? xObject["type"] : ""; + obj.visible = xObject["visible"] != undefined ? xObject["visible"] : true; + obj.rotation = xObject["rotation"] != undefined ? xObject["rotation"] : 0; + var xGid = xObject["gid"]; + var xEllipse = xObject["ellipse"]; + var xPolygon = xObject["polygon"]; + var xPolyline = xObject["polyline"]; + var xText = xObject["text"]; + var xPoint = xObject["point"]; + if (xGid) { + obj.tile = new es.TmxLayerTile(map, xGid, Math.round(obj.x), Math.round(obj.y)); + obj.objectType = es.TmxObjectType.tile; + } + else if (xEllipse) { + obj.objectType = es.TmxObjectType.ellipse; + } + else if (xPolygon) { + obj.points = this.parsePoints(xPolygon); + obj.objectType = es.TmxObjectType.polygon; + } + else if (xPolyline) { + obj.points = this.parsePoints(xPolyline); + obj.objectType = es.TmxObjectType.polyline; + } + else if (xText) { + obj.text = this.loadTmxText(new es.TmxText(), xText); + obj.objectType = es.TmxObjectType.text; + } + else if (xPoint) { + obj.objectType = es.TmxObjectType.point; + } + else { + obj.objectType = es.TmxObjectType.basic; + } + obj.properties = this.parsePropertyDict(xObject["properties"]); + return obj; + }; + TiledMapLoader.loadTmxText = function (text, xText) { + text.fontFamily = xText["fontfamily"] != undefined ? xText["fontfamily"] : "sans-serif"; + text.pixelSize = xText["pixelsize"] != undefined ? xText["pixelsize"] : 16; + text.wrap = xText["wrap"] != undefined ? xText["wrap"] : false; + text.color = es.TmxUtils.color16ToUnit(xText["color"]); + text.bold = xText["bold"] ? xText["bold"] : false; + text.italic = xText["italic"] ? xText["italic"] : false; + text.underline = xText["underline"] ? xText["underline"] : false; + text.strikeout = xText["strikeout"] ? xText["strikeout"] : false; + text.kerning = xText["kerning"] ? xText["kerning"] : true; + text.alignment = this.loadTmxAlignment(new es.TmxAlignment(), xText); + text.value = xText; + return text; + }; + TiledMapLoader.loadTmxAlignment = function (alignment, xText) { + function firstLetterToUpperCase(str) { + if (!str || str == "") + return str; + return str[0].toString().toUpperCase() + str.substr(1); + } + var xHorizontal = xText["halign"] != undefined ? xText["halign"] : "left"; + alignment.horizontal = es.TmxHorizontalAlignment[firstLetterToUpperCase(xHorizontal)]; + var xVertical = xText["valign"] != undefined ? xText["valign"] : "top"; + alignment.vertical = es.TmxVerticalAlignment[firstLetterToUpperCase((xVertical))]; + return alignment; + }; + TiledMapLoader.parsePoints = function (xPoints) { + var pointString = xPoints["points"]; + var pointStringPair = pointString.split(' '); + var points = []; + var index = 0; + for (var _i = 0, pointStringPair_1 = pointStringPair; _i < pointStringPair_1.length; _i++) { + var s = pointStringPair_1[_i]; + points[index++] = this.parsePoint(s); + } + return points; + }; + TiledMapLoader.parsePoint = function (s) { + var pt = s.split(','); + var x = Number(pt[0]); + var y = Number(pt[1]); + return new es.Vector2(x, y); + }; + TiledMapLoader.parseTmxTerrain = function (xTerrain) { + var terrain = new es.TmxTerrain(); + terrain.name = xTerrain["name"]; + terrain.tile = xTerrain["tile"]; + terrain.properties = this.parsePropertyDict(xTerrain["properties"]); + return terrain; + }; + TiledMapLoader.parseTmxTileOffset = function (xTileOffset) { + var tmxTileOffset = new es.TmxTileOffset(); + if (!xTileOffset) { + tmxTileOffset.x = 0; + tmxTileOffset.y = 0; + return tmxTileOffset; + } + tmxTileOffset.x = xTileOffset["x"]; + tmxTileOffset.y = xTileOffset["y"]; + return tmxTileOffset; + }; + TiledMapLoader.loadTmxImage = function (image, xImage) { + return __awaiter(this, void 0, void 0, function () { + var xSource, _a, _b, xData; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: + xSource = xImage["image"]; + if (!xSource) return [3, 2]; + image.source = "resource/assets/" + xSource; + _a = image; + _b = Bitmap.bind; + return [4, RES.getResByUrl(image.source, null, this, RES.ResourceItem.TYPE_IMAGE)]; + case 1: + _a.bitmap = new (_b.apply(Bitmap, [void 0, _c.sent()]))(); + return [3, 3]; + case 2: + image.format = xImage["format"]; + xData = xImage["data"]; + image.data = es.TmxUtils.decode(xData, xData["encoding"], xData["compression"]); + _c.label = 3; + case 3: + image.trans = es.TmxUtils.color16ToUnit(xImage["trans"]); + image.width = xImage["width"] != undefined ? xImage["width"] : 0; + image.height = xImage["height"] != undefined ? xImage["height"] : 0; + return [2, image]; + } + }); + }); + }; + return TiledMapLoader; + }()); + es.TiledMapLoader = TiledMapLoader; +})(es || (es = {})); +var es; (function (es) { var TiledRendering = (function () { function TiledRendering() { } - TiledRendering.renderMap = function (map, position, scale, layerDepth) { + TiledRendering.renderMap = function (map, container, position, scale, layerDepth) { var _this = this; map.layers.forEach(function (layer) { if (layer instanceof es.TmxLayer && layer.visible) { - _this.renderLayer(layer, position, scale, layerDepth); + _this.renderLayer(layer, container, position, scale, layerDepth); } else if (layer instanceof es.TmxImageLayer && layer.visible) { - _this.renderImageLayer(layer, position, scale, layerDepth); + _this.renderImageLayer(layer, container, position, scale, layerDepth); } else if (layer instanceof es.TmxGroup && layer.visible) { - _this.renderGroup(layer, position, scale, layerDepth); + _this.renderGroup(layer, container, position, scale, layerDepth); } else if (layer instanceof es.TmxObjectGroup && layer.visible) { - _this.renderObjectGroup(layer, position, scale, layerDepth); + _this.renderObjectGroup(layer, container, position, scale, layerDepth); } }); }; - TiledRendering.renderLayer = function (layer, position, scale, layerDepth) { + TiledRendering.renderLayer = function (layer, container, position, scale, layerDepth) { if (!layer.visible) return; var tileWidth = layer.map.tileWidth * scale.x; var tileHeight = layer.map.tileHeight * scale.y; - var color = new es.Color(0, 0, 0, layer.opacity * 255); + var color = es.DrawUtils.getColorMatrix(0x000000); for (var i = 0; i < layer.tiles.length; i++) { var tile = layer.tiles[i]; if (!tile) continue; - this.renderTile(tile, position, scale, tileWidth, tileHeight, color, layerDepth); + this.renderTile(tile, container, position, scale, tileWidth, tileHeight, color, layerDepth); } }; - TiledRendering.renderImageLayer = function (layer, position, scale, layerDepth) { + TiledRendering.renderImageLayer = function (layer, container, position, scale, layerDepth) { if (!layer.visible) return; - var color = new es.Color(0, 0, 0, layer.opacity * 255); + var color = es.DrawUtils.getColorMatrix(0x000000); var pos = es.Vector2.add(position, new es.Vector2(layer.offsetX, layer.offsetY).multiply(scale)); + if (!layer.image.bitmap.parent) + container.addChild(layer.image.bitmap); + layer.image.bitmap.x = pos.x; + layer.image.bitmap.y = pos.y; + layer.image.bitmap.scaleX = scale.x; + layer.image.bitmap.scaleY = scale.y; + layer.image.bitmap.filters = [color]; }; - TiledRendering.renderObjectGroup = function (objGroup, position, scale, layerDepth) { + TiledRendering.renderObjectGroup = function (objGroup, container, position, scale, layerDepth) { if (!objGroup.visible) return; for (var object in objGroup.objects) { - var obj = objGroup.objects.get(object); + var obj = objGroup.objects[object]; if (!obj.visible) continue; + if (!es.Core.debugRenderEndabled) { + if (obj.objectType != es.TmxObjectType.tile && obj.objectType != es.TmxObjectType.text) + continue; + } var pos = es.Vector2.add(position, new es.Vector2(obj.x, obj.y).multiply(scale)); switch (obj.objectType) { case es.TmxObjectType.basic: + if (!obj.shape.parent) + container.addChild(obj.shape); + var rect = new es.Rectangle(pos.x, pos.y, obj.width * scale.x, obj.height * scale.y); + es.DrawUtils.drawHollowRect(obj.shape, rect, objGroup.color); break; case es.TmxObjectType.point: var size = objGroup.map.tileWidth * 0.5; pos.x -= size * 0.5; pos.y -= size * 0.5; + if (!obj.shape.parent) + container.addChild(obj.shape); + es.DrawUtils.drawPixel(obj.shape, pos, objGroup.color, size); break; case es.TmxObjectType.tile: var tileset = objGroup.map.getTilesetForTileGid(obj.tile.gid); var sourceRect = tileset.tileRegions[obj.tile.gid]; pos.y -= obj.tile.tilesetTile.image.height; + if (!obj.tile.tilesetTile.image.bitmap) + container.addChild(obj.tile.tilesetTile.image.bitmap); + obj.tile.tilesetTile.image.bitmap.x = pos.x; + obj.tile.tilesetTile.image.bitmap.y = pos.y; + obj.tile.tilesetTile.image.bitmap.filters = []; + obj.tile.tilesetTile.image.bitmap.rotation = 0; + obj.tile.tilesetTile.image.bitmap.scaleX = scale.x; + obj.tile.tilesetTile.image.bitmap.scaleY = scale.y; break; case es.TmxObjectType.ellipse: pos = new es.Vector2(obj.x + obj.width * 0.5, obj.y + obj.height * 0.5).multiply(scale); + if (!obj.shape.parent) + container.addChild(obj.shape); + es.DrawUtils.drawCircle(obj.shape, pos, obj.width * 0.5, objGroup.color); break; case es.TmxObjectType.polygon: case es.TmxObjectType.polyline: var points = []; for (var i = 0; i < obj.points.length; i++) points[i] = es.Vector2.multiply(obj.points[i], scale); + es.DrawUtils.drawPoints(obj.shape, pos, points, objGroup.color, obj.objectType == es.TmxObjectType.polygon); break; case es.TmxObjectType.text: + if (!obj.textField.parent) + container.addChild(obj.textField); + es.DrawUtils.drawString(obj.textField, obj.text.value, pos, obj.text.color, es.MathHelper.toRadians(obj.rotation), es.Vector2.zero, 1); break; default: + if (es.Core.debugRenderEndabled) { + if (!obj.textField.parent) + container.addChild(obj.textField); + es.DrawUtils.drawString(obj.textField, obj.name + "(" + obj.type + ")", es.Vector2.subtract(pos, new es.Vector2(0, 15)), 0xffffff, 0, es.Vector2.zero, 1); + } break; } } }; - TiledRendering.renderGroup = function (group, position, scale, layerDepth) { + TiledRendering.renderGroup = function (group, container, position, scale, layerDepth) { var _this = this; if (!group.visible) return; group.layers.forEach(function (layer) { if (layer instanceof es.TmxGroup) { - _this.renderGroup(layer, position, scale, layerDepth); + _this.renderGroup(layer, container, position, scale, layerDepth); } if (layer instanceof es.TmxObjectGroup) { - _this.renderObjectGroup(layer, position, scale, layerDepth); + _this.renderObjectGroup(layer, container, position, scale, layerDepth); } if (layer instanceof es.TmxLayer) { - _this.renderLayer(layer, position, scale, layerDepth); + _this.renderLayer(layer, container, position, scale, layerDepth); } if (layer instanceof es.TmxImageLayer) { - _this.renderImageLayer(layer, position, scale, layerDepth); + _this.renderImageLayer(layer, container, position, scale, layerDepth); } }); }; - TiledRendering.renderTile = function (tile, position, scale, tileWidth, tileHeight, color, layerDepth) { + TiledRendering.renderTile = function (tile, container, position, scale, tileWidth, tileHeight, color, layerDepth) { var gid = tile.gid; var tilesetTile = tile.tilesetTile; if (tilesetTile && tilesetTile.animationFrames.length > 0) @@ -7935,8 +8378,24 @@ var es; ty += (tileHeight - sourceRect.height * scale.y); var pos = new es.Vector2(tx, ty).add(position); if (tile.tileset.image) { + if (!tile.tilesetTile.image.bitmap.parent) + container.addChild(tile.tilesetTile.image.bitmap); + tile.tilesetTile.image.bitmap.x = pos.x; + tile.tilesetTile.image.bitmap.y = pos.y; + tile.tilesetTile.image.bitmap.scaleX = scale.x; + tile.tilesetTile.image.bitmap.scaleY = scale.y; + tile.tilesetTile.image.bitmap.rotation = rotation; + tile.tilesetTile.image.bitmap.filters = [color]; } else { + if (!tilesetTile.image.bitmap) + container.addChild(tilesetTile.image.bitmap); + tilesetTile.image.bitmap.x = pos.x; + tilesetTile.image.bitmap.y = pos.y; + tilesetTile.image.bitmap.scaleX = scale.x; + tilesetTile.image.bitmap.scaleY = scale.y; + tilesetTile.image.bitmap.rotation = rotation; + tilesetTile.image.bitmap.filters = [color]; } }; return TiledRendering; @@ -8020,6 +8479,41 @@ var es; }()); es.TmxAnimationFrame = TmxAnimationFrame; })(es || (es = {})); +var es; +(function (es) { + var TmxUtils = (function () { + function TmxUtils() { + } + TmxUtils.decode = function (data, encoding, compression) { + compression = compression || "none"; + encoding = encoding || "none"; + var text = data.children[0].text; + switch (encoding) { + case "base64": + var decoded = es.Base64Utils.decodeBase64AsArray(text, 4); + return (compression === "none") ? decoded : es.Base64Utils.decompress(text, decoded, compression); + case "csv": + return es.Base64Utils.decodeCSV(text); + case "none": + var datas = []; + for (var i = 0; i < data.children.length; i++) { + datas[i] = +data.children[i].attributes.gid; + } + return datas; + default: + throw new Error("未定义的编码:" + encoding); + } + }; + TmxUtils.color16ToUnit = function ($color) { + if (!$color) + return 0x000000; + var colorStr = "0x" + $color.slice(1); + return parseInt(colorStr, 16); + }; + return TmxUtils; + }()); + es.TmxUtils = TmxUtils; +})(es || (es = {})); var ArrayUtils = (function () { function ArrayUtils() { } @@ -8184,128 +8678,103 @@ var ArrayUtils = (function () { }; return ArrayUtils; }()); -var Base64Utils = (function () { - function Base64Utils() { - } - Base64Utils.decode = function (input, isNotStr) { - if (isNotStr === void 0) { isNotStr = true; } - var output = ""; - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0; - input = this.getConfKey(input); - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - while (i < input.length) { - enc1 = this._keyAll.indexOf(input.charAt(i++)); - enc2 = this._keyAll.indexOf(input.charAt(i++)); - enc3 = this._keyAll.indexOf(input.charAt(i++)); - enc4 = this._keyAll.indexOf(input.charAt(i++)); - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - output = output + String.fromCharCode(chr1); - if (enc3 != 64) { - if (chr2 == 0) { - if (isNotStr) - output = output + String.fromCharCode(chr2); - } - else { - output = output + String.fromCharCode(chr2); - } - } - if (enc4 != 64) { - if (chr3 == 0) { - if (isNotStr) - output = output + String.fromCharCode(chr3); - } - else { - output = output + String.fromCharCode(chr3); - } - } +var es; +(function (es) { + var Base64Utils = (function () { + function Base64Utils() { } - output = this._utf8_decode(output); - return output; - }; - Base64Utils._utf8_encode = function (string) { - string = string.replace(/\r\n/g, "\n"); - var utftext = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - if (c < 128) { - utftext += String.fromCharCode(c); - } - else if ((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); + Object.defineProperty(Base64Utils, "nativeBase64", { + get: function () { + return (typeof (window.atob) === "function"); + }, + enumerable: true, + configurable: true + }); + Base64Utils.decode = function (input) { + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + if (this.nativeBase64) { + return window.atob(input); } else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); + var output = [], chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0; + while (i < input.length) { + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output.push(String.fromCharCode(chr1)); + if (enc3 !== 64) { + output.push(String.fromCharCode(chr2)); + } + if (enc4 !== 64) { + output.push(String.fromCharCode(chr3)); + } + } + output = output.join(""); + return output; } - } - return utftext; - }; - Base64Utils._utf8_decode = function (utftext) { - var string = ""; - var i = 0; - var c = 0; - var c1 = 0; - var c2 = 0; - var c3 = 0; - while (i < utftext.length) { - c = utftext.charCodeAt(i); - if (c < 128) { - string += String.fromCharCode(c); - i++; - } - else if ((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i + 1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; + }; + Base64Utils.encode = function (input) { + input = input.replace(/\r\n/g, "\n"); + if (this.nativeBase64) { + window.btoa(input); } else { - c2 = utftext.charCodeAt(i + 1); - c3 = utftext.charCodeAt(i + 2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; + var output = [], chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0; + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } + else if (isNaN(chr3)) { + enc4 = 64; + } + output.push(this._keyStr.charAt(enc1)); + output.push(this._keyStr.charAt(enc2)); + output.push(this._keyStr.charAt(enc3)); + output.push(this._keyStr.charAt(enc4)); + } + output = output.join(""); + return output; } - } - return string; - }; - Base64Utils.getConfKey = function (key) { - return key.slice(1, key.length); - }; - Base64Utils._keyNum = "0123456789+/"; - Base64Utils._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - Base64Utils._keyAll = Base64Utils._keyNum + Base64Utils._keyStr; - Base64Utils.encode = function (input) { - var output = ""; - var chr1, chr2, chr3, enc1, enc2, enc3, enc4; - var i = 0; - input = this._utf8_encode(input); - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - if (isNaN(chr2)) { - enc3 = enc4 = 64; + }; + Base64Utils.decodeBase64AsArray = function (input, bytes) { + bytes = bytes || 1; + var dec = Base64Utils.decode(input), i, j, len; + var ar = new Uint32Array(dec.length / bytes); + for (i = 0, len = dec.length / bytes; i < len; i++) { + ar[i] = 0; + for (j = bytes - 1; j >= 0; --j) { + ar[i] += dec.charCodeAt((i * bytes) + j) << (j << 3); + } } - else if (isNaN(chr3)) { - enc4 = 64; + return ar; + }; + Base64Utils.decompress = function (data, decoded, compression) { + throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!"); + }; + Base64Utils.decodeCSV = function (input) { + var entries = input.replace("\n", "").trim().split(","); + var result = []; + for (var i = 0; i < entries.length; i++) { + result.push(+entries[i]); } - output = output + - this._keyAll.charAt(enc1) + this._keyAll.charAt(enc2) + - this._keyAll.charAt(enc3) + this._keyAll.charAt(enc4); - } - return this._keyStr.charAt(Math.floor((Math.random() * this._keyStr.length))) + output; - }; - return Base64Utils; -}()); + return result; + }; + Base64Utils._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + return Base64Utils; + }()); + es.Base64Utils = Base64Utils; +})(es || (es = {})); var es; (function (es) { var Color = (function () { @@ -8433,6 +8902,23 @@ var es; if (thickness === void 0) { thickness = 1; } this.drawLineAngle(shape, start, es.MathHelper.angleBetweenVectors(start, end), es.Vector2.distance(start, end), color, thickness); }; + DrawUtils.drawCircle = function (shape, position, radius, color) { + shape.graphics.beginFill(color); + shape.graphics.drawCircle(position.x, position.y, radius); + shape.graphics.endFill(); + }; + DrawUtils.drawPoints = function (shape, position, points, color, closePoly, thickness) { + if (closePoly === void 0) { closePoly = true; } + if (thickness === void 0) { thickness = 1; } + if (points.length < 2) + return; + for (var i = 1; i < points.length; i++) + this.drawLine(shape, es.Vector2.add(position, points[i - 1]), es.Vector2.add(position, points[i]), color, thickness); + if (closePoly) + this.drawLine(shape, es.Vector2.add(position, points[points.length - 1]), es.Vector2.add(position, points[0]), color, thickness); + }; + DrawUtils.drawString = function (textField, text, position, color, rotation, origin, scale) { + }; DrawUtils.drawLineAngle = function (shape, start, radians, length, color, thickness) { if (thickness === void 0) { thickness = 1; } shape.graphics.beginFill(color); diff --git a/source/bin/framework.min.js b/source/bin/framework.min.js index cc518cb6..3bc92582 100644 --- a/source/bin/framework.min.js +++ b/source/bin/framework.min.js @@ -1 +1 @@ -window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}c((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===c())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return e.zeroVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return e.unitVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return e.unitXVector},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return e.unitYVector},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var e=1/Math.sqrt(t.x*t.x+t.y*t.y);return t.x*=e,t.y*=e,t},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=t,this.y*=t,this},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e.unitYVector=new e(0,1),e.unitXVector=new e(1,0),e.unitVector2=new e(1,1),e.zeroVector2=new e(0,0),e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=e}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:t.DrawUtils.drawLine(i,this.start,this.end,this.color);break;case e.hollowRectangle:t.DrawUtils.drawHollowRect(i,this.rectangle,this.color);break;case e.pixel:t.DrawUtils.drawPixel(i,new t.Vector2(this.x,this.y),this.color,this.size);break;case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e.prototype.clone=function(){var t=ObjectUtils.clone(this);return t.entity=null,t},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance._scene=t,this._instance.addChild(t),this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),this.addChild(this._scene),[4,this._scene.begin()]):[3,2];case 1:i.sent(),i.label=2;case 2:return[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),this.initialize()},i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},r.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},r.prototype.zoomIn=function(t){this.zoom+=t},r.prototype.zoomOut=function(t){this.zoom-=t},r.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._transformMatrix)},r.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._inverseTransformMatrix)},r.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},r.prototype.onAddedToEntity=function(){this.follow(this._targetEntity,this._cameraStyle)},r.prototype.update=function(){var e=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5));this._worldSpaceDeadZone.x=this.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.position=t.Vector2.lerp(this.position,t.Vector2.add(this.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.position=this.clampToMapSize(this.position),this.entity.transform.roundPosition())},r.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},r.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},r.prototype.follow=function(i,n){switch(void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n,this._cameraStyle){case e.cameraWindow:var r=this.bounds.width/6,o=this.bounds.height/3;this.deadzone=new t.Rectangle((this.bounds.width-r)/2,(this.bounds.height-o)/2,r,o);break;case e.lockOn:this.deadzone=new t.Rectangle(this.bounds.width/2,this.bounds.height/2,10,10)}},r.prototype.setCenteredDeadzone=function(e,i){this.deadzone=new t.Rectangle((this.bounds.width-e)/2,(this.bounds.height-i)/2,e,i)},r.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},r}(t.Component);t.Camera=n}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.color=0,i._areBoundsDirty=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.isVisibleFromCamera=function(t){return this.isVisible=t.bounds.intersects(this.bounds),this.isVisible},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(t){this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y,this.displayObject.scaleX=this.entity.scale.x,this.displayObject.scaleY=this.entity.scale.y,this.displayObject.rotation=this.entity.rotation},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(t){this.sync(t),this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=function(){return function(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}}();t.Sprite=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.sprites=t,this.frameRate=e}}();t.SpriteAnimation=e}(es||(es={})),function(t){var e,i;!function(t){t[t.loop=0]="loop",t[t.once=1]="once",t[t.clampForever=2]="clampForever",t[t.pingPong=3]="pingPong",t[t.pingPongOnce=4]="pingPongOnce"}(e=t.LoopMode||(t.LoopMode={})),function(t){t[t.none=0]="none",t[t.running=1]="running",t[t.paused=2]="paused",t[t.completed=3]="completed"}(i=t.State||(t.State={}));var n=function(n){function r(t){var e=n.call(this,t)||this;return e.speed=1,e.animationState=i.none,e._elapsedTime=0,e._animations=new Map,e}return __extends(r,n),Object.defineProperty(r.prototype,"isRunning",{get:function(){return this.animationState==i.running},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"animations",{get:function(){return this._animations},enumerable:!0,configurable:!0}),r.prototype.update=function(){if(this.animationState==i.running&&this.currentAnimation){var n=this.currentAnimation,r=1/(n.frameRate*this.speed),o=r*n.sprites.length;this._elapsedTime+=t.Time.deltaTime;var s=Math.abs(this._elapsedTime);if(this._loopMode==e.once&&s>o||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.sprite=n.sprites[this.currentFrame]);var a=Math.floor(s/r),c=n.sprites.length;if(c>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var h=c-1;this.currentFrame=h-Math.abs(h-a%(2*h))}else this.currentFrame=a%c;this.sprite=n.sprites[this.currentFrame]}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.sprite=this.currentAnimation.sprites[0],this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(t,i,n){void 0===i&&(i=null),void 0===n&&(n=!0);var r=e.call(this)||this;return r.physicsLayer=1,r.tiledMap=t,r._shouldCreateColliders=n,i&&(r.collisionLayer=t.tileLayers.get(i)),r}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var c=void 0;e.$renderBuffer?c=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(c=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var h=c.$renderBuffer.getPixels(i.x,i.y,o,s),u=0,l=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,c=Math.floor(a)+1;if(53==c){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var h=i.getDay();if(0==h&&(h=7),e&&(!o||h<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(c>9?"":"0")+c)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),c=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(c="0"+c),i?s+e+a+e+c:a+e+c},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.camera=e,this.renderOrder=t}return t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t}();t.Renderer=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,0,null)||this}return __extends(e,t),e.prototype.render=function(t){var e=this.camera?this.camera:t.camera;this.beginRender(e);for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.Epsilon=1e-5,e.Rad2Deg=57.29578,e.Deg2Rad=.0174532924,e.PiOver2=Math.PI/2,e}();t.MathHelper=e}(es||(es={})),function(t){t.matrixPool=[];var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"m11",{get:function(){return this.a},set:function(t){this.a=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m12",{get:function(){return this.b},set:function(t){this.b=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m21",{get:function(){return this.c},set:function(t){this.c=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m22",{get:function(){return this.d},set:function(t){this.d=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m31",{get:function(){return this.tx},set:function(t){this.tx=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m32",{get:function(){return this.ty},set:function(t){this.ty=t},enumerable:!0,configurable:!0}),i.create=function(){var e=t.matrixPool.pop();return e||(e=new i),e},i.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return 1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e),this},i.prototype.rotate=function(t){if(0!==(t=+t)){t/=DEG_TO_RAD;var e=Math.cos(t),i=Math.sin(t),n=this.a,r=this.b,o=this.c,s=this.d,a=this.tx,c=this.ty;this.a=n*e-r*i,this.b=n*i+r*e,this.c=o*e-s*i,this.d=o*i+s*e,this.tx=a*e-c*i,this.ty=a*i+c*e}return this},i.prototype.invert=function(){return this.$invertInto(this),this},i.prototype.add=function(t){return this.m11+=t.m11,this.m12+=t.m12,this.m21+=t.m21,this.m22+=t.m22,this.m31+=t.m31,this.m32+=t.m32,this},i.prototype.substract=function(t){return this.m11-=t.m11,this.m12-=t.m12,this.m21-=t.m21,this.m22-=t.m22,this.m31-=t.m31,this.m32-=t.m32,this},i.prototype.divide=function(t){return this.m11/=t.m11,this.m12/=t.m12,this.m21/=t.m21,this.m22/=t.m22,this.m31/=t.m31,this.m32/=t.m32,this},i.prototype.multiply=function(t){var e=this.m11*t.m11+this.m12*t.m21,i=this.m11*t.m12+this.m12*t.m22,n=this.m21*t.m11+this.m22*t.m21,r=this.m21*t.m12+this.m22*t.m22,o=this.m31*t.m11+this.m32*t.m21+t.m31,s=this.m31*t.m12+this.m32*t.m22+t.m32;return this.m11=e,this.m12=i,this.m21=n,this.m22=r,this.m31=o,this.m32=s,this},i.prototype.determinant=function(){return this.m11*this.m22-this.m12*this.m21},i.prototype.release=function(e){e&&t.matrixPool.push(e)},i}(egret.Matrix);t.Matrix2D=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"max",{get:function(){return new t.Vector2(this.right,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"center",{get:function(){return new t.Vector2(this.x+this.width/2,this.y+this.height/2)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return new t.Vector2(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){return new t.Vector2(this.width,this.height)},set:function(t){this.width=t.x,this.height=t.y},enumerable:!0,configurable:!0}),i.fromMinMax=function(t,e,n,r){return new i(t,e,n-t,r-e)},i.rectEncompassingPoints=function(t){for(var e=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=0;on&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return e}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if((e=Math.max(r,e))>(i=Math.min(o,i)))return e}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return e}else{var a=1/t.direction.y,c=(this.y-t.start.y)*a,h=(this.y+this.height-t.start.y)*a;if(c>h){var u=c;c=h,h=u}if((e=Math.max(c,e))>(i=Math.max(h,i)))return e}return e},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var u=(c.x*o.y-c.y*o.x)/a;return!(u<0||u>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),c=s.x*a.y-s.y*a.x;if(0==c)return o;var h=t.Vector2.subtract(n,e),u=(h.x*a.y-h.y*a.x)/c;if(u<0||u>1)return o;var l=(h.x*s.y-h.y*s.x)/c;return l<0||l>1?o:o=t.Vector2.add(e,new t.Vector2(u*s.x,u*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.isCircleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.isCircleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.clone=function(){return ObjectUtils.clone(this)},t}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);o=t.Vector2.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n=Number.MAX_VALUE,r=new t.Vector2(0,0);for(var o,s=new t.Vector2(0,0),a=0;ae.y!=this.points[r].y>e.y&&e.x<(this.points[r].x-this.points[n].x)*(e.y-this.points[n].y)/(this.points[r].y-this.points[n].y)+this.points[n].x&&(i=!i);return i},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return s;var a,c=t.Vector2.add(o.start,t.Vector2.add(o.direction,new t.Vector2(s))),h=0;c.xi.bounds.right&&(h|=1),c.yi.bounds.bottom&&(h|=2);var u=a+h;return 3==u&&console.log("m == 3. corner "+t.Time.frameCount),s},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,c=Number.POSITIVE_INFINITY,h=new t.Vector2,u=t.Vector2.subtract(e.position,i.position),l=0;l0&&(o=!1),!o)return!1;(g=Math.abs(g))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,0,n.normal),a=i.containsPoint(e.position);if(0>e.radius*e.radius&&!a)return!1;a?r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(0)-e.radius)):r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));return n.minimumTranslationVector=r,n.point=t.Vector2.add(s,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,n.normal=t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var l=(h.x*s.y-h.y*s.x)/c;return!(l<0||l>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(u),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),c=t.Vector2.dot(a,s),h=t.Vector2.dot(a,a)-n.radius*n.radius;if(h>0&&c>0)return!1;var u=c*c-h;return!(u<0)&&(r.fraction=-c-Math.sqrt(u),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal=r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),c=o.rayIntersects(a);return c<=1&&(r.fraction=c,r.distance=n.length()*c,r.normal=new t.Vector2(-n.x),r.normal=r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(c))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var c=this.cellAtPosition(s,a);if(c)for(var h=function(r){var o=c[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer))return"continue";e.intersects(o.bounds)&&(u._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||u._tempHashSet.push(o))},u=this,l=0;l=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.size-1;e>=0;e--)if(this.tilesets.get(e.toString()).firstGid<=t)return this.tilesets.get(e.toString());console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers.get(t)},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=function(){function e(){}return e.renderMap=function(e,i,n,r){var o=this;e.layers.forEach(function(e){e instanceof t.TmxLayer&&e.visible?o.renderLayer(e,i,n,r):e instanceof t.TmxImageLayer&&e.visible?o.renderImageLayer(e,i,n,r):e instanceof t.TmxGroup&&e.visible?o.renderGroup(e,i,n,r):e instanceof t.TmxObjectGroup&&e.visible&&o.renderObjectGroup(e,i,n,r)})},e.renderLayer=function(e,i,n,r){if(e.visible)for(var o=e.map.tileWidth*n.x,s=e.map.tileHeight*n.y,a=new t.Color(0,0,0,255*e.opacity),c=0;c0&&(c=h.currentAnimationFrameGid);var u=e.tileset.tileRegions.get(c),l=e.x*r,p=e.y*o,f=0;e.diagonalFlip&&(e.horizontalFlip&&e.verticalFlip?(f=t.MathHelper.PiOver2,l+=o+(u.height*n.y-o),p-=u.width*n.x-r):e.horizontalFlip?(f=-t.MathHelper.PiOver2,p+=o):e.verticalFlip?(f=t.MathHelper.PiOver2,l+=r+(u.height*n.y-o),p+=r-u.width*n.x):(f=-t.MathHelper.PiOver2,p+=o)),0==f&&(p+=o-u.height*n.y);new t.Vector2(l,p).add(i);e.tileset.image},e}();t.TiledRendering=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={}));var ArrayUtils=function(){function t(){}return t.bubbleSort=function(t){for(var e=!1,i=0;ii;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}(),Base64Utils=function(){function t(){}return t.decode=function(t,e){void 0===e&&(e=!0);var i,n,r,o,s,a,c="",h=0;for(t=(t=this.getConfKey(t)).replace(/[^A-Za-z0-9\+\/\=]/g,"");h>4,n=(15&o)<<4|(s=this._keyAll.indexOf(t.charAt(h++)))>>2,r=(3&s)<<6|(a=this._keyAll.indexOf(t.charAt(h++))),c+=String.fromCharCode(i),64!=s&&(0==n?e&&(c+=String.fromCharCode(n)):c+=String.fromCharCode(n)),64!=a&&(0==r?e&&(c+=String.fromCharCode(r)):c+=String.fromCharCode(r));return c=this._utf8_decode(c)},t._utf8_encode=function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e},t._utf8_decode=function(t){for(var e="",i=0,n=0,r=0,o=0;i191&&n<224?(r=t.charCodeAt(i+1),e+=String.fromCharCode((31&n)<<6|63&r),i+=2):(r=t.charCodeAt(i+1),o=t.charCodeAt(i+2),e+=String.fromCharCode((15&n)<<12|(63&r)<<6|63&o),i+=3);return e},t.getConfKey=function(t){return t.slice(1,t.length)},t._keyNum="0123456789+/",t._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",t._keyAll=t._keyNum+t._keyStr,t.encode=function(t){var e,i,n,r,o,s,a,c="",h=0;for(t=this._utf8_encode(t);h>2,o=(3&e)<<4|(i=t.charCodeAt(h++))>>4,s=(15&i)<<2|(n=t.charCodeAt(h++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),c=c+this._keyAll.charAt(r)+this._keyAll.charAt(o)+this._keyAll.charAt(s)+this._keyAll.charAt(a);return this._keyStr.charAt(Math.floor(Math.random()*this._keyStr.length))+c},t}();!function(t){var e=function(){function e(e,i,n,r){if(0!=(4294967040&(e|i|n|r))){var o=t.MathHelper.clamp(e,0,255),s=t.MathHelper.clamp(i,0,255),a=t.MathHelper.clamp(n,0,255),c=t.MathHelper.clamp(r,0,255);this._packedValue=c<<24|a<<16|s<<8|o}else this._packedValue=r<<24|n<<16|i<<8|e}return Object.defineProperty(e.prototype,"b",{get:function(){return this._packedValue>>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){t.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function e(){}return e.drawLine=function(e,i,n,r,o){void 0===o&&(o=1),this.drawLineAngle(e,i,t.MathHelper.angleBetweenVectors(i,n),t.Vector2.distance(i,n),r,o)},e.drawLineAngle=function(t,e,i,n,r,o){void 0===o&&(o=1),t.graphics.beginFill(r),t.graphics.drawRect(e.x,e.y,1,1),t.graphics.endFill(),t.scaleX=n,t.scaleY=o,t.$anchorOffsetX=0,t.$anchorOffsetY=0,t.rotation=i},e.drawHollowRect=function(t,e,i,n){void 0===n&&(n=1),this.drawHollowRectR(t,e.x,e.y,e.width,e.height,i,n)},e.drawHollowRectR=function(e,i,n,r,o,s,a){void 0===a&&(a=1);var c=new t.Vector2(i,n).round(),h=new t.Vector2(i+r,n).round(),u=new t.Vector2(i+r,n+o).round(),l=new t.Vector2(i,n+o).round();this.drawLine(e,c,h,s,a),this.drawLine(e,h,u,s,a),this.drawLine(e,u,l,s,a),this.drawLine(e,l,c,s,a)},e.drawPixel=function(e,i,n,r){void 0===r&&(r=1);var o=new t.Rectangle(i.x,i.y,r,r);1!=r&&(o.x-=.5*r,o.y-=.5*r),e.graphics.beginFill(n),e.graphics.drawRect(o.x,o.y,o.width,o.height),e.graphics.endFill()},e.getColorMatrix=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];return e[0]=Math.floor(t/256/256)/255,e[6]=Math.floor(t/256%256)/255,e[12]=t%256/255,new egret.ColorMatrixFilter(e)},e}();t.DrawUtils=e}(es||(es={})),function(t){var e=function(){function e(){}return e.oppositeEdge=function(e){switch(e){case t.Edge.bottom:return t.Edge.top;case t.Edge.top:return t.Edge.bottom;case t.Edge.left:return t.Edge.right;case t.Edge.right:return t.Edge.left}},e.isHorizontal=function(e){return e==t.Edge.right||e==t.Edge.left},e.isVertical=function(e){return e==t.Edge.top||e==t.Edge.bottom},e}();t.EdgeExt=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.func=t,this.context=e}}();t.FuncPack=e;var i=function(){function t(){this._messageTable=new Map}return t.prototype.addObserver=function(t,i,n){var r=this._messageTable.get(t);r||(r=[],this._messageTable.set(t,r)),-1!=r.findIndex(function(t){return t.func==i})&&console.warn("您试图添加相同的观察者两次"),r.push(new e(i,n))},t.prototype.removeObserver=function(t,e){var i=this._messageTable.get(t),n=i.findIndex(function(t){return t.func==e});-1!=n&&i.removeAt(n)},t.prototype.emit=function(t,e){var i=this._messageTable.get(t);if(i)for(var n=i.length-1;n>=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function e(){this.x=0,this.y=0,this.touchPoint=-1,this.touchDown=!1}return Object.defineProperty(e.prototype,"position",{get:function(){return new t.Vector2(this.x,this.y)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.x=0,this.y=0,this.touchDown=!1,this.touchPoint=-1},e}();t.TouchState=e;var i=function(){function i(){}return Object.defineProperty(i,"gameTouchs",{get:function(){return this._gameTouchs},enumerable:!0,configurable:!0}),Object.defineProperty(i,"resolutionScale",{get:function(){return this._resolutionScale},enumerable:!0,configurable:!0}),Object.defineProperty(i,"totalTouchCount",{get:function(){return this._totalTouchCount},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPosition",{get:function(){return this._gameTouchs[0]?this._gameTouchs[0].position:t.Vector2.zero},enumerable:!0,configurable:!0}),Object.defineProperty(i,"maxSupportedTouch",{get:function(){return t.Core._instance.stage.maxTouches},set:function(e){t.Core._instance.stage.maxTouches=e,this.initTouchCache()},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPositionDelta",{get:function(){var e=t.Vector2.subtract(this.touchPosition,this._previousTouchState.position);return e.length()>0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.scaledPosition=function(e){var i=new t.Vector2(e.x-this._resolutionOffset.x,e.y-this._resolutionOffset.y);return t.Vector2.multiply(i,this.resolutionScale)},i.initTouchCache=function(){this._totalTouchCount=0,this._touchIndex=0,this._gameTouchs.length=0;for(var t=0;t0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={}));var THREAD_ID=Math.floor(1e3*Math.random())+"-"+Date.now(),nextTick=function(t){setTimeout(t,0)},LockUtils=function(){function t(t){this._keyX="mutex_key_"+t+"_X",this._keyY="mutex_key_"+t+"_Y",this.setItem=egret.localStorage.setItem.bind(localStorage),this.getItem=egret.localStorage.getItem.bind(localStorage),this.removeItem=egret.localStorage.removeItem.bind(localStorage)}return t.prototype.lock=function(){var t=this;return new Promise(function(e,i){var n=function(){t.setItem(t._keyX,THREAD_ID),null===!t.getItem(t._keyY)&&nextTick(n),t.setItem(t._keyY,THREAD_ID),t.getItem(t._keyX)!==THREAD_ID?setTimeout(function(){t.getItem(t._keyY)===THREAD_ID?(e(),t.removeItem(t._keyY)):nextTick(n)},10):(e(),t.removeItem(t._keyY))};n()})},t}();!function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,c=i[this._triPrev[s]],h=i[s],u=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(c,h,u)){var l=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[l],c,h,u)){a=!1;break}l=this._triNext[l]}while(l!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e=t.Vector2.divide(e,new t.Vector2(i)):e.x=e.y=0,e},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this._frameKey="frame",this._logKey="log",this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[r].snapMin=l.logs[r].min,l.logs[r].snapMax=l.logs[r].max,l.logs[r].snapAvg=l.logs[r].avg,l.logs[r].samples=0)):(l.logs[r].min=h,l.logs[r].max=h,l.logs[r].avg=h,l.logs[r].initialized=!0)}s.markCount=o.nestCount,s.nestCount=o.nestCount}t.stopwacth.reset(),t.stopwacth.start()}})},e.prototype.beginMark=function(t,i,n){var r=this;void 0===n&&(n=0),new LockUtils(this._frameKey).lock().then(function(){if(n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var o=r._curLog.bars[n];if(o.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(o.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var s=r._markerNameToIdMap.get(t);isNaN(s)&&(s=r.markers.length,r._markerNameToIdMap.set(t,s)),o.markerNests[o.nestCount++]=o.markCount,o.markers[o.markCount].markerId=s,o.markers[o.markCount].color=i,o.markers[o.markCount].beginTime=r.stopwacth.getTime(),o.markers[o.markCount].endTime=-1})},e.prototype.endMark=function(t,i){var n=this;void 0===i&&(i=0),new LockUtils(this._frameKey).lock().then(function(){if(i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var r=n._curLog.bars[i];if(r.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var o=n._markerNameToIdMap.get(t);if(isNaN(o))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var s=r.markerNests[--r.nestCount];if(r.markers[s].markerId!=o)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");r.markers[s].endTime=n.stopwacth.getTime()})},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){var t=this;new LockUtils(this._logKey).lock().then(function(){var e=parseInt(egret.localStorage.getItem(t._logKey),10);e+=1,egret.localStorage.setItem(t._logKey,e.toString()),t.markers.forEach(function(t){for(var e=0;e0&&(n+=e.barHeight+2*e.barPadding,r=Math.max(r,t.markers[t.markCount-1].endTime))});var o=this.sampleFrames*(1/60*1e3);this._frameAdjust=r>o?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,r/(1/60*1e3)+1),this._frameAdjust=0);t.y,e.barHeight}},e.prototype.onGraphicsDeviceReset=function(){var i=new t.Layout;this._position=i.place(new t.Vector2(this.width,e.barHeight),0,.01,t.Alignment.bottomCenter).location},e.maxBars=8,e.maxSamples=256,e.maxNestCall=32,e.barHeight=8,e.maxSampleFrames=4,e.logSnapDuration=120,e.barPadding=2,e.autoAdjustDelay=30,e}();t.TimeRuler=e;var i=function(){return function(){this.bars=new Array(e.maxBars),this.bars.fill(new n,0,e.maxBars)}}();t.FrameLog=i;var n=function(){return function(){this.markers=new Array(e.maxSamples),this.markCount=0,this.markerNests=new Array(e.maxNestCall),this.nestCount=0,this.markers.fill(new r,0,e.maxSamples),this.markerNests.fill(0,0,e.maxNestCall)}}();t.MarkerCollection=n;var r=function(){return function(){this.markerId=0,this.beginTime=0,this.endTime=0,this.color=0}}();t.Marker=r;var o=function(){return function(t){this.logs=new Array(e.maxBars),this.name=t,this.logs.fill(new s,0,e.maxBars)}}();t.MarkerInfo=o;var s=function(){return function(){this.snapMin=0,this.snapMax=0,this.snapAvg=0,this.min=0,this.max=0,this.avg=0,this.samples=0,this.color=0,this.initialized=!1}}();t.MarkerLog=s}(es||(es={})); \ No newline at end of file +window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}c((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===c())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return e.zeroVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return e.unitVector2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return e.unitXVector},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return e.unitYVector},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var e=1/Math.sqrt(t.x*t.x+t.y*t.y);return t.x*=e,t.y*=e,t},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);return this.x*=t,this.y*=t,this},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e.unitYVector=new e(0,1),e.unitXVector=new e(1,0),e.unitVector2=new e(1,1),e.zeroVector2=new e(0,0),e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===u())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=e}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:t.DrawUtils.drawLine(i,this.start,this.end,this.color);break;case e.hollowRectangle:t.DrawUtils.drawHollowRect(i,this.rectangle,this.color);break;case e.pixel:t.DrawUtils.drawPixel(i,new t.Vector2(this.x,this.y),this.color,this.size);break;case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e.prototype.clone=function(){var t=ObjectUtils.clone(this);return t.entity=null,t},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance._scene=t,this._instance.addChild(t),this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),this.addChild(this._scene),[4,this._scene.begin()]):[3,2];case 1:i.sent(),i.label=2;case 2:return[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),this.initialize()},i.debugRenderEndabled=!1,i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},r.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},r.prototype.zoomIn=function(t){this.zoom+=t},r.prototype.zoomOut=function(t){this.zoom-=t},r.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._transformMatrix)},r.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2.transform(e,this._inverseTransformMatrix)},r.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},r.prototype.onAddedToEntity=function(){this.follow(this._targetEntity,this._cameraStyle)},r.prototype.update=function(){var e=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5));this._worldSpaceDeadZone.x=this.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.position=t.Vector2.lerp(this.position,t.Vector2.add(this.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.position=this.clampToMapSize(this.position),this.entity.transform.roundPosition())},r.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(new t.Vector2(this.bounds.width,this.bounds.height),new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},r.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},r.prototype.follow=function(i,n){switch(void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n,this._cameraStyle){case e.cameraWindow:var r=this.bounds.width/6,o=this.bounds.height/3;this.deadzone=new t.Rectangle((this.bounds.width-r)/2,(this.bounds.height-o)/2,r,o);break;case e.lockOn:this.deadzone=new t.Rectangle(this.bounds.width/2,this.bounds.height/2,10,10)}},r.prototype.setCenteredDeadzone=function(e,i){this.deadzone=new t.Rectangle((this.bounds.width-e)/2,(this.bounds.height-i)/2,e,i)},r.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},r}(t.Component);t.Camera=n}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.color=0,i._areBoundsDirty=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.isVisibleFromCamera=function(t){return this.isVisible=t.bounds.intersects(this.bounds),this.isVisible},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(t){this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y,this.displayObject.scaleX=this.entity.scale.x,this.displayObject.scaleY=this.entity.scale.y,this.displayObject.rotation=this.entity.rotation},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(t){this.sync(t),this.displayObject.x=this.entity.position.x+this.localOffset.x-t.position.x+t.origin.x,this.displayObject.y=this.entity.position.y+this.localOffset.y-t.position.y+t.origin.y},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=function(){return function(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}}();t.Sprite=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.sprites=t,this.frameRate=e}}();t.SpriteAnimation=e}(es||(es={})),function(t){var e,i;!function(t){t[t.loop=0]="loop",t[t.once=1]="once",t[t.clampForever=2]="clampForever",t[t.pingPong=3]="pingPong",t[t.pingPongOnce=4]="pingPongOnce"}(e=t.LoopMode||(t.LoopMode={})),function(t){t[t.none=0]="none",t[t.running=1]="running",t[t.paused=2]="paused",t[t.completed=3]="completed"}(i=t.State||(t.State={}));var n=function(n){function r(t){var e=n.call(this,t)||this;return e.speed=1,e.animationState=i.none,e._elapsedTime=0,e._animations=new Map,e}return __extends(r,n),Object.defineProperty(r.prototype,"isRunning",{get:function(){return this.animationState==i.running},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"animations",{get:function(){return this._animations},enumerable:!0,configurable:!0}),r.prototype.update=function(){if(this.animationState==i.running&&this.currentAnimation){var n=this.currentAnimation,r=1/(n.frameRate*this.speed),o=r*n.sprites.length;this._elapsedTime+=t.Time.deltaTime;var s=Math.abs(this._elapsedTime);if(this._loopMode==e.once&&s>o||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.sprite=n.sprites[this.currentFrame]);var a=Math.floor(s/r),c=n.sprites.length;if(c>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var h=c-1;this.currentFrame=h-Math.abs(h-a%(2*h))}else this.currentFrame=a%c;this.sprite=n.sprites[this.currentFrame]}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.sprite=this.currentAnimation.sprites[0],this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(t,i,n){void 0===i&&(i=null),void 0===n&&(n=!0);var r=e.call(this)||this;return r.physicsLayer=1,r.tiledMap=t,r._shouldCreateColliders=n,r.displayObject=new egret.DisplayObjectContainer,i&&(r.collisionLayer=t.tileLayers[i]),r}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var c=void 0;e.$renderBuffer?c=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(c=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var h=c.$renderBuffer.getPixels(i.x,i.y,o,s),u=0,l=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,c=Math.floor(a)+1;if(53==c){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var h=i.getDay();if(0==h&&(h=7),e&&(!o||h<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(c>9?"":"0")+c)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),c=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(c="0"+c),i?s+e+a+e+c:a+e+c},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.camera=e,this.renderOrder=t}return t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t}();t.Renderer=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,0,null)||this}return __extends(e,t),e.prototype.render=function(t){var e=this.camera?this.camera:t.camera;this.beginRender(e);for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.Epsilon=1e-5,e.Rad2Deg=57.29578,e.Deg2Rad=.0174532924,e.PiOver2=Math.PI/2,e}();t.MathHelper=e}(es||(es={})),function(t){t.matrixPool=[];var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"m11",{get:function(){return this.a},set:function(t){this.a=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m12",{get:function(){return this.b},set:function(t){this.b=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m21",{get:function(){return this.c},set:function(t){this.c=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m22",{get:function(){return this.d},set:function(t){this.d=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m31",{get:function(){return this.tx},set:function(t){this.tx=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"m32",{get:function(){return this.ty},set:function(t){this.ty=t},enumerable:!0,configurable:!0}),i.create=function(){var e=t.matrixPool.pop();return e||(e=new i),e},i.prototype.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return 1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e),this},i.prototype.rotate=function(t){if(0!==(t=+t)){t/=DEG_TO_RAD;var e=Math.cos(t),i=Math.sin(t),n=this.a,r=this.b,o=this.c,s=this.d,a=this.tx,c=this.ty;this.a=n*e-r*i,this.b=n*i+r*e,this.c=o*e-s*i,this.d=o*i+s*e,this.tx=a*e-c*i,this.ty=a*i+c*e}return this},i.prototype.invert=function(){return this.$invertInto(this),this},i.prototype.add=function(t){return this.m11+=t.m11,this.m12+=t.m12,this.m21+=t.m21,this.m22+=t.m22,this.m31+=t.m31,this.m32+=t.m32,this},i.prototype.substract=function(t){return this.m11-=t.m11,this.m12-=t.m12,this.m21-=t.m21,this.m22-=t.m22,this.m31-=t.m31,this.m32-=t.m32,this},i.prototype.divide=function(t){return this.m11/=t.m11,this.m12/=t.m12,this.m21/=t.m21,this.m22/=t.m22,this.m31/=t.m31,this.m32/=t.m32,this},i.prototype.multiply=function(t){var e=this.m11*t.m11+this.m12*t.m21,i=this.m11*t.m12+this.m12*t.m22,n=this.m21*t.m11+this.m22*t.m21,r=this.m21*t.m12+this.m22*t.m22,o=this.m31*t.m11+this.m32*t.m21+t.m31,s=this.m31*t.m12+this.m32*t.m22+t.m32;return this.m11=e,this.m12=i,this.m21=n,this.m22=r,this.m31=o,this.m32=s,this},i.prototype.determinant=function(){return this.m11*this.m22-this.m12*this.m21},i.prototype.release=function(e){e&&t.matrixPool.push(e)},i}(egret.Matrix);t.Matrix2D=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),Object.defineProperty(i.prototype,"max",{get:function(){return new t.Vector2(this.right,this.bottom)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"center",{get:function(){return new t.Vector2(this.x+this.width/2,this.y+this.height/2)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"location",{get:function(){return new t.Vector2(this.x,this.y)},set:function(t){this.x=t.x,this.y=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"size",{get:function(){return new t.Vector2(this.width,this.height)},set:function(t){this.width=t.x,this.height=t.y},enumerable:!0,configurable:!0}),i.fromMinMax=function(t,e,n,r){return new i(t,e,n-t,r-e)},i.rectEncompassingPoints=function(t){for(var e=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,r=Number.NEGATIVE_INFINITY,o=0;on&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return e}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if((e=Math.max(r,e))>(i=Math.min(o,i)))return e}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return e}else{var a=1/t.direction.y,c=(this.y-t.start.y)*a,h=(this.y+this.height-t.start.y)*a;if(c>h){var u=c;c=h,h=u}if((e=Math.max(c,e))>(i=Math.max(h,i)))return e}return e},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var u=(c.x*o.y-c.y*o.x)/a;return!(u<0||u>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),c=s.x*a.y-s.y*a.x;if(0==c)return o;var h=t.Vector2.subtract(n,e),u=(h.x*a.y-h.y*a.x)/c;if(u<0||u>1)return o;var l=(h.x*s.y-h.y*s.x)/c;return l<0||l>1?o:o=t.Vector2.add(e,new t.Vector2(u*s.x,u*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.isCircleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.isCircleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.clone=function(){return ObjectUtils.clone(this)},t}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);o=t.Vector2.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n=Number.MAX_VALUE,r=new t.Vector2(0,0);for(var o,s=new t.Vector2(0,0),a=0;ae.y!=this.points[r].y>e.y&&e.x<(this.points[r].x-this.points[n].x)*(e.y-this.points[n].y)/(this.points[r].y-this.points[n].y)+this.points[n].x&&(i=!i);return i},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return s;var a,c=t.Vector2.add(o.start,t.Vector2.add(o.direction,new t.Vector2(s))),h=0;c.xi.bounds.right&&(h|=1),c.yi.bounds.bottom&&(h|=2);var u=a+h;return 3==u&&console.log("m == 3. corner "+t.Time.frameCount),s},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,c=Number.POSITIVE_INFINITY,h=new t.Vector2,u=t.Vector2.subtract(e.position,i.position),l=0;l0&&(o=!1),!o)return!1;(g=Math.abs(g))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,0,n.normal),a=i.containsPoint(e.position);if(0>e.radius*e.radius&&!a)return!1;a?r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(0)-e.radius)):r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));return n.minimumTranslationVector=r,n.point=t.Vector2.add(s,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,n.normal=t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var l=(h.x*s.y-h.y*s.x)/c;return!(l<0||l>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(u),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),c=t.Vector2.dot(a,s),h=t.Vector2.dot(a,a)-n.radius*n.radius;if(h>0&&c>0)return!1;var u=c*c-h;return!(u<0)&&(r.fraction=-c-Math.sqrt(u),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal=r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),c=o.rayIntersects(a);return c<=1&&(r.fraction=c,r.distance=n.length()*c,r.normal=new t.Vector2(-n.x),r.normal=r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(c))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var c=this.cellAtPosition(s,a);if(c)for(var h=function(r){var o=c[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer))return"continue";e.intersects(o.bounds)&&(u._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||u._tempHashSet.push(o))},u=this,l=0;l=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.length-1;e>=0;e--)if(this.tilesets[e].firstGid<=t)return this.tilesets[e];console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers[t]},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){this.shape=new egret.Shape,this.textField=new egret.TextField}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=egret.Bitmap,i=function(){function i(){}return i.loadTmxMap=function(t,e){var i=RES.getRes(e);return this.loadTmxMapData(t,i)},i.loadTmxMapData=function(e,i){return __awaiter(this,void 0,void 0,function(){var n,r,o,s;return __generator(this,function(a){switch(a.label){case 0:e.version=i.version,e.tiledVersion=i.tiledversion,e.width=i.width,e.height=i.height,e.tileWidth=i.tilewidth,e.tileHeight=i.tileheight,e.hexSideLength=i.hexsidelength,e.orientation=this.parseOrientationType(i.orientation),e.staggerAxis=this.parseStaggerAxisType(i.staggeraxis),e.staggerIndex=this.parseStaggerIndexType(i.staggerindex),e.renderOrder=this.parseRenderOrderType(i.renderorder),e.nextObjectID=i.nextobjectid,e.backgroundColor=t.TmxUtils.color16ToUnit(i.color),e.properties=this.parsePropertyDict(i.properties),e.maxTileWidth=e.tileWidth,e.maxTileHeight=e.tileHeight,e.tilesets=[],n=0,r=i.tilesets,a.label=1;case 1:return nt.map.maxTileWidth&&(t.map.maxTileWidth=e.image.width),e.image.height>t.map.maxTileHeight&&(t.map.maxTileHeight=e.image.height))}),t.tileRegions.forEach(function(e){var i=e.width,n=e.height;i>t.map.maxTileWidth&&(t.map.maxTileWidth=i),i>t.map.maxTileHeight&&(t.map.maxTileHeight=n)})},i.parseOrientationType=function(e){return"unknown"==e?t.OrientationType.unknown:"orthogonal"==e?t.OrientationType.orthogonal:"isometric"==e?t.OrientationType.isometric:"staggered"==e?t.OrientationType.staggered:"hexagonal"==e?t.OrientationType.hexagonal:t.OrientationType.unknown},i.parseStaggerAxisType=function(e){return"y"==e?t.StaggerAxisType.y:t.StaggerAxisType.x},i.parseStaggerIndexType=function(e){return"even"==e?t.StaggerIndexType.even:t.StaggerIndexType.odd},i.parseRenderOrderType=function(e){return"right-up"==e?t.RenderOrderType.rightUp:"left-down"==e?t.RenderOrderType.leftDown:"left-up"==e?t.RenderOrderType.leftUp:t.RenderOrderType.rightDown},i.parsePropertyDict=function(t){if(!t)return null;for(var e=new Map,i=0,n=t.property;i=e.columns));y+=e.tileWidth+e.spacing);else e.tiles.forEach(function(i){e.tileRegions.set(r+i.id,new t.Rectangle(0,0,i.image.width,i.image.height))});return[2,e]}})})},i.loadTmxTilesetTile=function(e,i,n,r){return __awaiter(this,void 0,void 0,function(){var r,o,s,a,c,h,u;return __generator(this,function(l){switch(l.label){case 0:return e.tileset=i,e.id=n.id,e.terrainEdges=n.terrain,e.probability=null!=n.probability?n.probability:1,e.type=n.type,(r=n.image)?(o=e,[4,this.loadTmxImage(new t.TmxImage,r)]):[3,2];case 1:o.image=l.sent(),l.label=2;case 2:if(e.objectGroups=[],n.objectgroup)for(s=0,a=n.objectgroup;s0&&(h=u.currentAnimationFrameGid);var l=e.tileset.tileRegions.get(h),p=e.x*o,d=e.y*s,f=0;e.diagonalFlip&&(e.horizontalFlip&&e.verticalFlip?(f=t.MathHelper.PiOver2,p+=s+(l.height*r.y-s),d-=l.width*r.x-o):e.horizontalFlip?(f=-t.MathHelper.PiOver2,d+=s):e.verticalFlip?(f=t.MathHelper.PiOver2,p+=o+(l.height*r.y-s),d+=o-l.width*r.x):(f=-t.MathHelper.PiOver2,d+=s)),0==f&&(d+=s-l.height*r.y);var m=new t.Vector2(p,d).add(n);e.tileset.image?(e.tilesetTile.image.bitmap.parent||i.addChild(e.tilesetTile.image.bitmap),e.tilesetTile.image.bitmap.x=m.x,e.tilesetTile.image.bitmap.y=m.y,e.tilesetTile.image.bitmap.scaleX=r.x,e.tilesetTile.image.bitmap.scaleY=r.y,e.tilesetTile.image.bitmap.rotation=f,e.tilesetTile.image.bitmap.filters=[a]):(u.image.bitmap||i.addChild(u.image.bitmap),u.image.bitmap.x=m.x,u.image.bitmap.y=m.y,u.image.bitmap.scaleX=r.x,u.image.bitmap.scaleY=r.y,u.image.bitmap.rotation=f,u.image.bitmap.filters=[a])},e}();t.TiledRendering=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={})),function(t){var e=function(){function e(){}return e.decode=function(e,i,n){n=n||"none",i=i||"none";var r=e.children[0].text;switch(i){case"base64":var o=t.Base64Utils.decodeBase64AsArray(r,4);return"none"===n?o:t.Base64Utils.decompress(r,o,n);case"csv":return t.Base64Utils.decodeCSV(r);case"none":for(var s=[],a=0;ai;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}();!function(t){var e=function(){function t(){}return Object.defineProperty(t,"nativeBase64",{get:function(){return"function"==typeof window.atob},enumerable:!0,configurable:!0}),t.decode=function(t){if(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),this.nativeBase64)return window.atob(t);for(var e,i,n,r,o,s,a=[],c=0;c>4,i=(15&r)<<4|(o=this._keyStr.indexOf(t.charAt(c++)))>>2,n=(3&o)<<6|(s=this._keyStr.indexOf(t.charAt(c++))),a.push(String.fromCharCode(e)),64!==o&&a.push(String.fromCharCode(i)),64!==s&&a.push(String.fromCharCode(n));return a=a.join("")},t.encode=function(t){if(t=t.replace(/\r\n/g,"\n"),!this.nativeBase64){for(var e,i,n,r,o,s,a,c=[],h=0;h>2,o=(3&e)<<4|(i=t.charCodeAt(h++))>>4,s=(15&i)<<2|(n=t.charCodeAt(h++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),c.push(this._keyStr.charAt(r)),c.push(this._keyStr.charAt(o)),c.push(this._keyStr.charAt(s)),c.push(this._keyStr.charAt(a));return c=c.join("")}window.btoa(t)},t.decodeBase64AsArray=function(e,i){i=i||1;var n,r,o,s=t.decode(e),a=new Uint32Array(s.length/i);for(n=0,o=s.length/i;n=0;--r)a[n]+=s.charCodeAt(n*i+r)<<(r<<3);return a},t.decompress=function(t,e,i){throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!")},t.decodeCSV=function(t){for(var e=t.replace("\n","").trim().split(","),i=[],n=0;n>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){t.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function e(){}return e.drawLine=function(e,i,n,r,o){void 0===o&&(o=1),this.drawLineAngle(e,i,t.MathHelper.angleBetweenVectors(i,n),t.Vector2.distance(i,n),r,o)},e.drawCircle=function(t,e,i,n){t.graphics.beginFill(n),t.graphics.drawCircle(e.x,e.y,i),t.graphics.endFill()},e.drawPoints=function(e,i,n,r,o,s){if(void 0===o&&(o=!0),void 0===s&&(s=1),!(n.length<2)){for(var a=1;a=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function e(){this.x=0,this.y=0,this.touchPoint=-1,this.touchDown=!1}return Object.defineProperty(e.prototype,"position",{get:function(){return new t.Vector2(this.x,this.y)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.x=0,this.y=0,this.touchDown=!1,this.touchPoint=-1},e}();t.TouchState=e;var i=function(){function i(){}return Object.defineProperty(i,"gameTouchs",{get:function(){return this._gameTouchs},enumerable:!0,configurable:!0}),Object.defineProperty(i,"resolutionScale",{get:function(){return this._resolutionScale},enumerable:!0,configurable:!0}),Object.defineProperty(i,"totalTouchCount",{get:function(){return this._totalTouchCount},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPosition",{get:function(){return this._gameTouchs[0]?this._gameTouchs[0].position:t.Vector2.zero},enumerable:!0,configurable:!0}),Object.defineProperty(i,"maxSupportedTouch",{get:function(){return t.Core._instance.stage.maxTouches},set:function(e){t.Core._instance.stage.maxTouches=e,this.initTouchCache()},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPositionDelta",{get:function(){var e=t.Vector2.subtract(this.touchPosition,this._previousTouchState.position);return e.length()>0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.scaledPosition=function(e){var i=new t.Vector2(e.x-this._resolutionOffset.x,e.y-this._resolutionOffset.y);return t.Vector2.multiply(i,this.resolutionScale)},i.initTouchCache=function(){this._totalTouchCount=0,this._touchIndex=0,this._gameTouchs.length=0;for(var t=0;t0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={}));var THREAD_ID=Math.floor(1e3*Math.random())+"-"+Date.now(),nextTick=function(t){setTimeout(t,0)},LockUtils=function(){function t(t){this._keyX="mutex_key_"+t+"_X",this._keyY="mutex_key_"+t+"_Y",this.setItem=egret.localStorage.setItem.bind(localStorage),this.getItem=egret.localStorage.getItem.bind(localStorage),this.removeItem=egret.localStorage.removeItem.bind(localStorage)}return t.prototype.lock=function(){var t=this;return new Promise(function(e,i){var n=function(){t.setItem(t._keyX,THREAD_ID),null===!t.getItem(t._keyY)&&nextTick(n),t.setItem(t._keyY,THREAD_ID),t.getItem(t._keyX)!==THREAD_ID?setTimeout(function(){t.getItem(t._keyY)===THREAD_ID?(e(),t.removeItem(t._keyY)):nextTick(n)},10):(e(),t.removeItem(t._keyY))};n()})},t}();!function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,c=i[this._triPrev[s]],h=i[s],u=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(c,h,u)){var l=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[l],c,h,u)){a=!1;break}l=this._triNext[l]}while(l!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e=t.Vector2.divide(e,new t.Vector2(i)):e.x=e.y=0,e},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this._frameKey="frame",this._logKey="log",this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[r].snapMin=l.logs[r].min,l.logs[r].snapMax=l.logs[r].max,l.logs[r].snapAvg=l.logs[r].avg,l.logs[r].samples=0)):(l.logs[r].min=h,l.logs[r].max=h,l.logs[r].avg=h,l.logs[r].initialized=!0)}s.markCount=o.nestCount,s.nestCount=o.nestCount}t.stopwacth.reset(),t.stopwacth.start()}})},e.prototype.beginMark=function(t,i,n){var r=this;void 0===n&&(n=0),new LockUtils(this._frameKey).lock().then(function(){if(n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var o=r._curLog.bars[n];if(o.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(o.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var s=r._markerNameToIdMap.get(t);isNaN(s)&&(s=r.markers.length,r._markerNameToIdMap.set(t,s)),o.markerNests[o.nestCount++]=o.markCount,o.markers[o.markCount].markerId=s,o.markers[o.markCount].color=i,o.markers[o.markCount].beginTime=r.stopwacth.getTime(),o.markers[o.markCount].endTime=-1})},e.prototype.endMark=function(t,i){var n=this;void 0===i&&(i=0),new LockUtils(this._frameKey).lock().then(function(){if(i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var r=n._curLog.bars[i];if(r.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var o=n._markerNameToIdMap.get(t);if(isNaN(o))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var s=r.markerNests[--r.nestCount];if(r.markers[s].markerId!=o)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");r.markers[s].endTime=n.stopwacth.getTime()})},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){var t=this;new LockUtils(this._logKey).lock().then(function(){var e=parseInt(egret.localStorage.getItem(t._logKey),10);e+=1,egret.localStorage.setItem(t._logKey,e.toString()),t.markers.forEach(function(t){for(var e=0;e0&&(n+=e.barHeight+2*e.barPadding,r=Math.max(r,t.markers[t.markCount-1].endTime))});var o=this.sampleFrames*(1/60*1e3);this._frameAdjust=r>o?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,r/(1/60*1e3)+1),this._frameAdjust=0);t.y,e.barHeight}},e.prototype.onGraphicsDeviceReset=function(){var i=new t.Layout;this._position=i.place(new t.Vector2(this.width,e.barHeight),0,.01,t.Alignment.bottomCenter).location},e.maxBars=8,e.maxSamples=256,e.maxNestCall=32,e.barHeight=8,e.maxSampleFrames=4,e.logSnapDuration=120,e.barPadding=2,e.autoAdjustDelay=30,e}();t.TimeRuler=e;var i=function(){return function(){this.bars=new Array(e.maxBars),this.bars.fill(new n,0,e.maxBars)}}();t.FrameLog=i;var n=function(){return function(){this.markers=new Array(e.maxSamples),this.markCount=0,this.markerNests=new Array(e.maxNestCall),this.nestCount=0,this.markers.fill(new r,0,e.maxSamples),this.markerNests.fill(0,0,e.maxNestCall)}}();t.MarkerCollection=n;var r=function(){return function(){this.markerId=0,this.beginTime=0,this.endTime=0,this.color=0}}();t.Marker=r;var o=function(){return function(t){this.logs=new Array(e.maxBars),this.name=t,this.logs.fill(new s,0,e.maxBars)}}();t.MarkerInfo=o;var s=function(){return function(){this.snapMin=0,this.snapMax=0,this.snapAvg=0,this.min=0,this.max=0,this.avg=0,this.samples=0,this.color=0,this.initialized=!1}}();t.MarkerLog=s}(es||(es={})); \ No newline at end of file diff --git a/source/src/ECS/Components/TiledMapRenderer.ts b/source/src/ECS/Components/TiledMapRenderer.ts index 9094f42a..5951a9f2 100644 --- a/source/src/ECS/Components/TiledMapRenderer.ts +++ b/source/src/ECS/Components/TiledMapRenderer.ts @@ -1,15 +1,17 @@ module es { - export class TiledMapRenderer extends RenderableComponent{ + export class TiledMapRenderer extends RenderableComponent { public tiledMap: TmxMap; public physicsLayer: number = 1 << 0; /** * 如果空,所有层将被渲染 */ public layerIndicesToRender: number[]; - public get width(){ + + public get width() { return this.tiledMap.width * this.tiledMap.tileWidth; } - public get height(){ + + public get height() { return this.tiledMap.height * this.tiledMap.tileHeight; } @@ -17,13 +19,14 @@ module es { public _shouldCreateColliders: boolean; public _colliders: Collider[]; - constructor(tiledMap: TmxMap, collisionLayerName: string = null, shouldCreateColliders: boolean = true){ + constructor(tiledMap: TmxMap, collisionLayerName: string = null, shouldCreateColliders: boolean = true) { super(); this.tiledMap = tiledMap; this._shouldCreateColliders = shouldCreateColliders; + this.displayObject = new egret.DisplayObjectContainer(); - if (collisionLayerName){ - this.collisionLayer = tiledMap.tileLayers.get(collisionLayerName); + if (collisionLayerName) { + this.collisionLayer = tiledMap.tileLayers[collisionLayerName]; } } @@ -31,7 +34,7 @@ module es { * 将此组件设置为只渲染单层 * @param layerName */ - public setLayerToRender(layerName: string){ + public setLayerToRender(layerName: string) { this.layerIndicesToRender = []; this.layerIndicesToRender[0] = this.getLayerIndex(layerName); } @@ -40,18 +43,18 @@ module es { * 设置该组件应该按名称呈现哪些层。如果你知道索引,你可以直接设置layerIndicesToRender * @param layerNames */ - public setLayersToRender(...layerNames: string[]){ + public setLayersToRender(...layerNames: string[]) { this.layerIndicesToRender = []; - for (let i = 0; i < layerNames.length; i ++) + for (let i = 0; i < layerNames.length; i++) this.layerIndicesToRender[i] = this.getLayerIndex(layerNames[i]); } - private getLayerIndex(layerName: string){ + private getLayerIndex(layerName: string) { let index = 0; let layerType = this.tiledMap.getLayer(layerName); - for (let layer in this.tiledMap.layers){ + for (let layer in this.tiledMap.layers) { if (this.tiledMap.layers.hasOwnProperty(layer) && - this.tiledMap.layers.get(layer) == layerType){ + this.tiledMap.layers[layer] == layerType) { return index; } } @@ -64,14 +67,14 @@ module es { return this.tiledMap.worldToTilePositionY(yPos); } - public getColumnAtWorldPosition(xPos: number): number{ + public getColumnAtWorldPosition(xPos: number): number { xPos -= this.entity.transform.position.x + this._localOffset.x; return this.tiledMap.worldToTilePositionX(xPos); } public onEntityTransformChanged(comp: transform.Component) { // 这里我们只处理位置变化。平铺地图不能缩放 - if (this._shouldCreateColliders && comp == transform.Component.position){ + if (this._shouldCreateColliders && comp == transform.Component.position) { this.removeColliders(); this.addColliders(); } @@ -90,19 +93,19 @@ module es { } public render(camera: es.Camera) { - if (!this.layerIndicesToRender){ - TiledRendering.renderMap(this.tiledMap, Vector2.add(this.entity.transform.position, this._localOffset), + if (!this.layerIndicesToRender) { + TiledRendering.renderMap(this.tiledMap, this.displayObject as egret.DisplayObjectContainer, Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); - }else{ - for (let i = 0; i < this.tiledMap.layers.size; i ++){ - if (this.tiledMap.layers.get(i.toString()).visible && this.layerIndicesToRender.contains(i)) - TiledRendering.renderLayer(this.tiledMap.layers.get(i.toString()), Vector2.add(this.entity.transform.position, this._localOffset), + } else { + for (let i = 0; i < this.tiledMap.layers.length; i++) { + if (this.tiledMap.layers[i].visible && this.layerIndicesToRender.contains(i)) + TiledRendering.renderLayer(this.tiledMap.layers[i] as TmxLayer, this.displayObject as egret.DisplayObjectContainer, Vector2.add(this.entity.transform.position, this._localOffset), this.transform.scale, this.renderLayer); } } } - public addColliders(){ + public addColliders() { if (!this.collisionLayer || !this._shouldCreateColliders) return; @@ -111,7 +114,7 @@ module es { // 为我们收到的矩形创建碰撞器 this._colliders = []; - for (let i = 0; i < collisionRects.length; i ++){ + for (let i = 0; i < collisionRects.length; i++) { let collider = new BoxCollider().createBoxRect(collisionRects[i].x + this._localOffset.x, collisionRects[i].y + this._localOffset.y, collisionRects[i].width, collisionRects[i].height); collider.physicsLayer = this.physicsLayer; @@ -122,11 +125,11 @@ module es { } } - public removeColliders(){ + public removeColliders() { if (this._colliders == null) return; - for (let collider of this._colliders){ + for (let collider of this._colliders) { Physics.removeCollider(collider); } this._colliders = null; diff --git a/source/src/ECS/Core.ts b/source/src/ECS/Core.ts index 2e07ea4f..59746857 100644 --- a/source/src/ECS/Core.ts +++ b/source/src/ECS/Core.ts @@ -7,6 +7,10 @@ module es { * 核心发射器。只发出核心级别的事件 */ public static emitter: Emitter; + /** + * 是否启用调试渲染 + */ + public static debugRenderEndabled = false; /** * 全局访问图形设备 */ diff --git a/source/src/Tiled/Group.ts b/source/src/Tiled/Group.ts index 5c83cadb..92c5ff3a 100644 --- a/source/src/Tiled/Group.ts +++ b/source/src/Tiled/Group.ts @@ -7,10 +7,10 @@ module es { public properties: Map; public visible: boolean; public name: string; - public layers: TmxList; - public tileLayers: TmxList; - public objectGroups: TmxList; - public imageLayers: TmxList; - public groups: TmxList; + public layers: ITmxLayer[]; + public tileLayers: TmxLayer[]; + public objectGroups: TmxObjectGroup[]; + public imageLayers: TmxImageLayer[]; + public groups: TmxGroup[]; } } \ No newline at end of file diff --git a/source/src/Tiled/Map.ts b/source/src/Tiled/Map.ts index 55e609b7..2cabd005 100644 --- a/source/src/Tiled/Map.ts +++ b/source/src/Tiled/Map.ts @@ -26,12 +26,12 @@ module es { * 包含所有的ITmxLayers,不管它们的具体类型是什么。 * 注意,TmxGroup中的层将不在此列表中。TmxGroup管理自己的层列表。 */ - public layers: TmxList; - public tilesets: TmxList; - public tileLayers: TmxList; - public objectGroups: TmxList; - public imageLayers: TmxList; - public groups: TmxList; + public layers: ITmxLayer[]; + public tilesets: TmxTileset[]; + public tileLayers: TmxLayer[]; + public objectGroups: TmxLayer[]; + public imageLayers: TmxImageLayer[]; + public groups: TmxGroup[]; public properties: Map; /** @@ -59,9 +59,9 @@ module es { if (gid == 0) return null; - for (let i = this.tilesets.size - 1; i >= 0; i --){ - if (this.tilesets.get(i.toString()).firstGid <= gid) - return this.tilesets.get(i.toString()); + for (let i = this.tilesets.length - 1; i >= 0; i --){ + if (this.tilesets[i].firstGid <= gid) + return this.tilesets[i]; } console.error(`tile gid${gid}未在任何tileset中找到`); @@ -96,7 +96,7 @@ module es { * @param name */ public getLayer(name: string): ITmxLayer { - return this.layers.get(name); + return this.layers[name]; } /** diff --git a/source/src/Tiled/ObjectGroup.ts b/source/src/Tiled/ObjectGroup.ts index 8c5414d8..6fc197d4 100644 --- a/source/src/Tiled/ObjectGroup.ts +++ b/source/src/Tiled/ObjectGroup.ts @@ -8,13 +8,15 @@ module es { public offsetY: number; public color: number; public drawOrder: DrawOrderType; - public objects: TmxList; + public objects: TmxObject[]; public properties: Map; } export class TmxObject implements ITmxElement { public id: number; public name: string; + public shape: egret.Shape; + public textField: egret.TextField; public objectType: TmxObjectType; public type: string; public x: number; @@ -27,6 +29,11 @@ module es { public text: TmxText; public points: Vector2[]; public properties: Map; + + constructor(){ + this.shape = new egret.Shape(); + this.textField = new egret.TextField(); + } } export class TmxText { diff --git a/source/src/Tiled/TiledCore.ts b/source/src/Tiled/TiledCore.ts index 4d4aa78a..c87eedbd 100644 --- a/source/src/Tiled/TiledCore.ts +++ b/source/src/Tiled/TiledCore.ts @@ -1,8 +1,8 @@ module es { export class TmxDocument { - public TmxDirectory: string; + public tmxDirectory: string; constructor(){ - this.TmxDirectory = ""; + this.tmxDirectory = ""; } } @@ -10,37 +10,40 @@ module es { name: string; } - export class TmxList extends Map{ - public _nameCount: Map = new Map(); - - public add(t: T){ - let tName = t.name; - - // 通过附加数字重命名重复的条目 - if (this.has(tName)) - this._nameCount.set(tName, this._nameCount.get(tName) + 1); - else - this._nameCount.set(tName, 0); - } - - protected getKeyForItem(item: T): string { - let name = item.name; - let count = this._nameCount.get(name); - - let dupes = 0; - - // 对于重复的键,附加一个计数器。对于病理情况,插入下划线以确保唯一性 - while (this.has(name)){ - name = name + Enumerable.repeat("_", dupes).toString() + count.toString(); - dupes ++; - } - - return name; - } - } + // export class TmxList extends Map{ + // public _nameCount: Map = new Map(); + // + // public add(t: T){ + // let tName = t.name; + // + // // 通过附加数字重命名重复的条目 + // if (this.has(tName)) + // this._nameCount.set(tName, this._nameCount.get(tName) + 1); + // else + // this._nameCount.set(tName, 0); + // } + // + // protected getKeyForItem(item: T): string { + // let name = item.name; + // let count = this._nameCount.get(name); + // + // let dupes = 0; + // + // // 对于重复的键,附加一个计数器。对于病理情况,插入下划线以确保唯一性 + // while (this.has(name)){ + // name = name + Enumerable.repeat("_", dupes).toString() + count.toString(); + // dupes ++; + // } + // + // return name; + // } + // } export class TmxImage { - public texture: egret.Texture; + public bitmap: egret.Bitmap; + public get texture(): egret.Texture{ + return this.bitmap.texture; + } public source: string; public format: string; public data: any; @@ -49,9 +52,9 @@ module es { public height: number; public dispose(){ - if (this.texture){ + if (this.bitmap){ this.texture.dispose(); - this.texture = null; + this.bitmap = null; } } } diff --git a/source/src/Tiled/TiledMapLoader.ts b/source/src/Tiled/TiledMapLoader.ts new file mode 100644 index 00000000..98422573 --- /dev/null +++ b/source/src/Tiled/TiledMapLoader.ts @@ -0,0 +1,406 @@ +module es { + import Bitmap = egret.Bitmap; + + export class TiledMapLoader { + public static loadTmxMap(map: TmxMap, filePath: string){ + let xMap = RES.getRes(filePath); + return this.loadTmxMapData(map, xMap); + } + + public static async loadTmxMapData(map: TmxMap, xMap: any){ + map.version = xMap["version"]; + map.tiledVersion = xMap["tiledversion"]; + map.width = xMap["width"]; + map.height = xMap["height"]; + map.tileWidth = xMap["tilewidth"]; + map.tileHeight = xMap["tileheight"]; + map.hexSideLength = xMap["hexsidelength"]; + + map.orientation = this.parseOrientationType(xMap["orientation"]); + map.staggerAxis = this.parseStaggerAxisType(xMap["staggeraxis"]); + map.staggerIndex = this.parseStaggerIndexType(xMap["staggerindex"]); + map.renderOrder = this.parseRenderOrderType(xMap["renderorder"]); + + map.nextObjectID = xMap["nextobjectid"]; + map.backgroundColor = TmxUtils.color16ToUnit(xMap["color"]); + + map.properties = this.parsePropertyDict(xMap["properties"]); + + // 我们保持记录的最大瓷砖大小的情况下,图像tileset随机大小 + map.maxTileWidth = map.tileWidth; + map.maxTileHeight = map.tileHeight; + + map.tilesets = []; + for (let e of xMap["tilesets"]){ + let tileset = await this.parseTmxTileset(map, e); + map.tilesets.push(tileset); + + this.updateMaxTileSizes(tileset); + } + + map.layers = []; + map.tileLayers = []; + map.objectGroups = []; + map.imageLayers = []; + map.groups = []; + + this.parseLayers(map, xMap, map, map.width, map.height, map.tmxDirectory); + + return map; + } + + /** + * 解析xEle中的所有层,将它们放入容器中 + * @param container + * @param xEle + * @param map + * @param width + * @param height + * @param tmxDirectory + */ + public static parseLayers(container: any, xEle: any, map: TmxMap, width: number, height: number, tmxDirectory: string){ + + } + + private static updateMaxTileSizes(tileset: TmxTileset){ + // 必须迭代字典,因为tile.gid可以是任意顺序的的任何数字 + tileset.tiles.forEach(tile => { + if (tile.image){ + if (tile.image.width > tileset.map.maxTileWidth) + tileset.map.maxTileWidth = tile.image.width; + if (tile.image.height > tileset.map.maxTileHeight) + tileset.map.maxTileHeight = tile.image.height; + } + }); + + tileset.tileRegions.forEach(region => { + let width = region.width; + let height = region.height; + if (width > tileset.map.maxTileWidth) tileset.map.maxTileWidth = width; + if (width > tileset.map.maxTileHeight) tileset.map.maxTileHeight = height; + }); + } + + public static parseOrientationType(type: string){ + if (type == "unknown") + return OrientationType.unknown; + if (type == "orthogonal") + return OrientationType.orthogonal; + if (type == "isometric") + return OrientationType.isometric; + if (type == "staggered") + return OrientationType.staggered; + if (type == "hexagonal") + return OrientationType.hexagonal; + + return OrientationType.unknown; + } + + public static parseStaggerAxisType(type: string){ + if (type == "y") + return StaggerAxisType.y; + return StaggerAxisType.x; + } + + public static parseStaggerIndexType(type: string){ + if (type == "even") + return StaggerIndexType.even; + return StaggerIndexType.odd; + } + + public static parseRenderOrderType(type: string){ + if (type == "right-up") + return RenderOrderType.rightUp; + if (type == "left-down") + return RenderOrderType.leftDown; + if (type == "left-up") + return RenderOrderType.leftUp; + return RenderOrderType.rightDown; + } + + public static parsePropertyDict(prop) { + if (!prop) + return null; + + let dict = new Map(); + for (let p of prop["property"]){ + let pname = p["name"]; + let valueAttr = p["value"]; + let pval = valueAttr ? valueAttr : p; + + dict.set(pname, pval); + } + return dict; + } + + public static async parseTmxTileset(map: TmxMap, xTileset: any){ + // firstgid总是在TMX中,而不是在TSX中 + let xFirstGid = xTileset["firstgid"]; + let firstGid = xFirstGid; + let source = xTileset["image"]; + + // 如果是嵌入式TmxTileset,即不是外部的,source将为null + if (!source){ + source = "resource/assets/" + source; + // 其他所有内容都在TSX文件中 + let xDocTileset = await RES.getResByUrl(source, null, this, RES.ResourceItem.TYPE_IMAGE); + let tileset = this.loadTmxTileset(new TmxTileset(), map, xDocTileset["tileset"], firstGid); + + return tileset; + } + + return this.loadTmxTileset(new TmxTileset(), map, xTileset, firstGid); + } + + public static async loadTmxTileset(tileset: TmxTileset, map: TmxMap, xTileset: any, + firstGid: number){ + tileset.map = map; + tileset.firstGid = firstGid; + + tileset.name = xTileset["name"]; + tileset.tileWidth = xTileset["tilewidth"]; + tileset.tileHeight = xTileset["tileheight"]; + tileset.spacing = xTileset["spacing"] != undefined ? xTileset["spacing"] : 0; + tileset.margin = xTileset["margin"] != undefined ? xTileset["margin"] : 0; + tileset.columns = xTileset["columns"]; + tileset.tileCount = xTileset["tilecount"]; + tileset.tileOffset = this.parseTmxTileOffset(xTileset["tileoffset"]); + + let xImage = xTileset["image"]; + if (xImage) + tileset.image = await this.loadTmxImage(new TmxImage(), xTileset); + + let xTerrainType = xTileset["terraintypes"]; + if (xTerrainType){ + tileset.terrains = []; + for (let e of xTerrainType["terrains"]) + tileset.terrains.push(this.parseTmxTerrain(e)); + } + + tileset.tiles = new Map(); + for (let xTile of xTileset["tiles"]){ + let tile = await this.loadTmxTilesetTile(new TmxTilesetTile(), tileset, xTile, tileset.terrains); + tileset.tiles[tile.id] = tile; + } + + tileset.properties = this.parsePropertyDict(xTileset["properties"]); + + // 缓存我们的源矩形为每个瓷砖,所以我们不必每次我们渲染计算他们。 + // 如果我们有一个image,这是一个普通的tileset,否则它是一个image tileset + tileset.tileRegions = new Map(); + if (tileset.image){ + let id = firstGid; + for (let y = tileset.margin; y < tileset.image.height - tileset.margin; y += tileset.tileHeight + tileset.spacing){ + let column = 0; + for (let x = tileset.margin; x < tileset.image.width - tileset.margin; x += tileset.tileWidth + tileset.spacing){ + tileset.tileRegions.set(id++, new Rectangle(x, y, tileset.tileWidth, tileset.tileHeight)); + + if (++column >= tileset.columns) + break; + } + } + }else{ + tileset.tiles.forEach(tile => { + tileset.tileRegions.set(firstGid + tile.id, new Rectangle(0, 0, tile.image.width, tile.image.height)); + }); + } + + return tileset; + } + + public static async loadTmxTilesetTile(tile: TmxTilesetTile, tileset: TmxTileset, xTile: any, terrains: TmxTerrain[]){ + tile.tileset = tileset; + tile.id = xTile["id"]; + + tile.terrainEdges = xTile["terrain"]; + tile.probability = xTile["probability"] != undefined ? xTile["probability"] : 1; + tile.type = xTile["type"]; + let xImage = xTile["image"]; + if (xImage){ + tile.image = await this.loadTmxImage(new TmxImage(), xImage); + } + + tile.objectGroups = []; + if (xTile["objectgroup"]) + for (let e of xTile["objectgroup"]) + tile.objectGroups.push(this.loadTmxObjectGroup(new TmxObjectGroup(), tileset.map, e)); + + tile.animationFrames = []; + if (xTile["animation"]){ + for (let e of xTile["animation"]["frame"]) + tile.animationFrames.push(this.loadTmxAnimationFrame(new TmxAnimationFrame(), e)); + } + + tile.properties = this.parsePropertyDict(xTile["properties"]); + if (tile.properties) + tile.processProperties(); + return tile; + } + + public static loadTmxAnimationFrame(frame: TmxAnimationFrame, xFrame: any){ + frame.gid = xFrame["tileid"]; + frame.duration = xFrame["duration"] / 1000; + + return frame; + } + + public static loadTmxObjectGroup(group: TmxObjectGroup, map: TmxMap, xObjectGroup: any) { + group.map = map; + group.name = xObjectGroup["name"] != undefined ? xObjectGroup["name"] : ""; + group.color = TmxUtils.color16ToUnit(xObjectGroup["color"]); + group.opacity = xObjectGroup["opacity"] != undefined ? xObjectGroup["opacity"] : 1; + group.visible = xObjectGroup["visible"] != undefined ? xObjectGroup["visible"] : true; + group.offsetX = xObjectGroup["offsetx"] != undefined ? xObjectGroup["offsetx"] : 0; + group.offsetY = xObjectGroup["offsety"] != undefined ? xObjectGroup["offsety"] : 0; + + let drawOrderDict = new Map(); + drawOrderDict.set("unknown", DrawOrderType.unkownOrder); + drawOrderDict.set("topdown", DrawOrderType.IndexOrder); + drawOrderDict.set("index", DrawOrderType.TopDown); + + let drawOrderValue = xObjectGroup["draworder"]; + if (drawOrderValue) + group.drawOrder = drawOrderDict[drawOrderValue]; + + group.objects = []; + for (let e of xObjectGroup["object"]) + group.objects.push(this.loadTmxObject(new TmxObject(), map, e)); + group.properties = this.parsePropertyDict(xObjectGroup["properties"]); + return group; + } + + public static loadTmxObject(obj: TmxObject, map: TmxMap, xObject: any){ + obj.id = xObject["id"] != undefined ? xObject["id"] : 0; + obj.name = xObject["name"] != undefined ? xObject["name"] : ""; + obj.x = xObject["x"]; + obj.y = xObject["y"]; + obj.width = xObject["width"] != undefined ? xObject["width"] : 0; + obj.height = xObject["height"] != undefined ? xObject["height"] : 0; + obj.type = xObject["type"] != undefined ? xObject["type"] : ""; + obj.visible = xObject["visible"] != undefined ? xObject["visible"] : true; + obj.rotation = xObject["rotation"] != undefined ? xObject["rotation"] : 0; + + // 评估对象类型并分配适当的内容 + let xGid = xObject["gid"]; + let xEllipse = xObject["ellipse"]; + let xPolygon = xObject["polygon"]; + let xPolyline = xObject["polyline"]; + let xText = xObject["text"]; + let xPoint = xObject["point"]; + + if (xGid){ + obj.tile = new TmxLayerTile(map, xGid, Math.round(obj.x), Math.round(obj.y)); + obj.objectType = TmxObjectType.tile; + }else if(xEllipse){ + obj.objectType = TmxObjectType.ellipse; + } else if(xPolygon){ + obj.points = this.parsePoints(xPolygon); + obj.objectType = TmxObjectType.polygon; + }else if(xPolyline){ + obj.points = this.parsePoints(xPolyline); + obj.objectType = TmxObjectType.polyline; + }else if(xText){ + obj.text = this.loadTmxText(new TmxText(), xText); + obj.objectType = TmxObjectType.text; + }else if(xPoint){ + obj.objectType = TmxObjectType.point; + }else{ + obj.objectType = TmxObjectType.basic; + } + + obj.properties = this.parsePropertyDict(xObject["properties"]); + return obj; + } + + public static loadTmxText(text: TmxText, xText: any){ + text.fontFamily = xText["fontfamily"] != undefined ? xText["fontfamily"] : "sans-serif"; + text.pixelSize = xText["pixelsize"] != undefined ? xText["pixelsize"] : 16; + text.wrap = xText["wrap"] != undefined ? xText["wrap"] : false; + text.color = TmxUtils.color16ToUnit(xText["color"]); + text.bold = xText["bold"] ? xText["bold"] : false; + text.italic = xText["italic"] ? xText["italic"] : false; + text.underline = xText["underline"] ? xText["underline"] : false; + text.strikeout = xText["strikeout"] ? xText["strikeout"] : false; + text.kerning = xText["kerning"] ? xText["kerning"] : true; + text.alignment = this.loadTmxAlignment(new TmxAlignment(), xText); + text.value = xText; + + return text; + } + + public static loadTmxAlignment(alignment: TmxAlignment, xText: any){ + function firstLetterToUpperCase(str: string) { + if (!str || str == "") + return str; + return str[0].toString().toUpperCase() + str.substr(1); + } + + let xHorizontal = xText["halign"] != undefined ? xText["halign"] : "left"; + alignment.horizontal = TmxHorizontalAlignment[firstLetterToUpperCase(xHorizontal)]; + + let xVertical = xText["valign"] != undefined ? xText["valign"] : "top"; + alignment.vertical = TmxVerticalAlignment[firstLetterToUpperCase((xVertical))]; + + return alignment; + } + + public static parsePoints(xPoints: any){ + let pointString: string = xPoints["points"]; + let pointStringPair = pointString.split(' '); + let points = []; + + let index = 0; + for (let s of pointStringPair) + points[index ++] = this.parsePoint(s); + return points; + } + + public static parsePoint(s: string){ + let pt = s.split(','); + let x = Number(pt[0]); + let y = Number(pt[1]); + return new Vector2(x, y); + } + + + public static parseTmxTerrain(xTerrain: any){ + let terrain = new TmxTerrain(); + terrain.name = xTerrain["name"]; + terrain.tile = xTerrain["tile"]; + terrain.properties = this.parsePropertyDict(xTerrain["properties"]); + + return terrain; + } + + public static parseTmxTileOffset(xTileOffset: any){ + let tmxTileOffset = new TmxTileOffset(); + if (!xTileOffset){ + tmxTileOffset.x = 0; + tmxTileOffset.y = 0; + return tmxTileOffset; + } + + tmxTileOffset.x = xTileOffset["x"]; + tmxTileOffset.y = xTileOffset["y"]; + return tmxTileOffset; + } + + public static async loadTmxImage(image: TmxImage, xImage: any){ + let xSource = xImage["image"]; + if (xSource) { + image.source = "resource/assets/" + xSource; + image.bitmap = new Bitmap(await RES.getResByUrl(image.source, null, this, RES.ResourceItem.TYPE_IMAGE)); + }else { + image.format = xImage["format"]; + let xData = xImage["data"]; + image.data = TmxUtils.decode(xData, xData["encoding"], xData["compression"]); + } + + image.trans = TmxUtils.color16ToUnit(xImage["trans"]); + image.width = xImage["width"] != undefined ? xImage["width"] : 0; + image.height = xImage["height"] != undefined ? xImage["height"] : 0; + + return image; + } + } +} \ No newline at end of file diff --git a/source/src/Tiled/TiledRendering.ts b/source/src/Tiled/TiledRendering.ts index 2c631258..8cabaa8f 100644 --- a/source/src/Tiled/TiledRendering.ts +++ b/source/src/Tiled/TiledRendering.ts @@ -1,119 +1,154 @@ module es { export class TiledRendering { - public static renderMap(map: TmxMap, position: Vector2, scale: Vector2, layerDepth: number) { + public static renderMap(map: TmxMap, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number) { map.layers.forEach(layer => { if (layer instanceof TmxLayer && layer.visible) { - this.renderLayer(layer, position, scale, layerDepth); + this.renderLayer(layer, container, position, scale, layerDepth); } else if (layer instanceof TmxImageLayer && layer.visible) { - this.renderImageLayer(layer, position, scale, layerDepth); + this.renderImageLayer(layer, container, position, scale, layerDepth); } else if (layer instanceof TmxGroup && layer.visible) { - this.renderGroup(layer, position, scale, layerDepth); + this.renderGroup(layer, container, position, scale, layerDepth); } else if (layer instanceof TmxObjectGroup && layer.visible) { - this.renderObjectGroup(layer, position, scale, layerDepth); + this.renderObjectGroup(layer, container, position, scale, layerDepth); } }); } - public static renderLayer(layer: TmxLayer, position: Vector2, scale: Vector2, layerDepth: number) { + public static renderLayer(layer: TmxLayer, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number) { if (!layer.visible) return; let tileWidth = layer.map.tileWidth * scale.x; let tileHeight = layer.map.tileHeight * scale.y; - let color = new Color(0, 0, 0, layer.opacity * 255); - for (let i = 0; i < layer.tiles.length; i ++){ + let color = DrawUtils.getColorMatrix(0x000000); + for (let i = 0; i < layer.tiles.length; i++) { let tile = layer.tiles[i]; if (!tile) continue; - this.renderTile(tile, position, scale, tileWidth, tileHeight, color, layerDepth); + this.renderTile(tile, container, position, scale, tileWidth, tileHeight, color, layerDepth); } } - public static renderImageLayer(layer: TmxImageLayer, position: Vector2, scale: Vector2, layerDepth: number) { + public static renderImageLayer(layer: TmxImageLayer, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number) { if (!layer.visible) return; - let color = new Color(0, 0, 0, layer.opacity * 255); + let color = DrawUtils.getColorMatrix(0x000000); let pos = Vector2.add(position, new Vector2(layer.offsetX, layer.offsetY).multiply(scale)); - // TODO: draw + if (!layer.image.bitmap.parent) + container.addChild(layer.image.bitmap); + layer.image.bitmap.x = pos.x; + layer.image.bitmap.y = pos.y; + layer.image.bitmap.scaleX = scale.x; + layer.image.bitmap.scaleY = scale.y; + layer.image.bitmap.filters = [color]; } - public static renderObjectGroup(objGroup: TmxObjectGroup, position: Vector2, scale: Vector2, layerDepth: number) { + public static renderObjectGroup(objGroup: TmxObjectGroup, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number) { if (!objGroup.visible) return; for (let object in objGroup.objects) { - let obj = objGroup.objects.get(object); + let obj = objGroup.objects[object]; if (!obj.visible) continue; - // TODO: debug draw + // 如果我们不调试渲染,我们只渲染平铺块和文本类型 + if (!Core.debugRenderEndabled){ + if (obj.objectType != TmxObjectType.tile && obj.objectType != TmxObjectType.text) + continue; + } + let pos = Vector2.add(position, new Vector2(obj.x, obj.y).multiply(scale)); switch (obj.objectType) { case TmxObjectType.basic: - // TODO: draw + if (!obj.shape.parent) + container.addChild(obj.shape); + + let rect = new Rectangle(pos.x, pos.y, obj.width * scale.x, obj.height * scale.y); + DrawUtils.drawHollowRect(obj.shape, rect, objGroup.color); break; case TmxObjectType.point: let size = objGroup.map.tileWidth * 0.5; pos.x -= size * 0.5; pos.y -= size * 0.5; - // TODO: draw + if (!obj.shape.parent) + container.addChild(obj.shape); + + DrawUtils.drawPixel(obj.shape, pos, objGroup.color, size); break; case TmxObjectType.tile: let tileset = objGroup.map.getTilesetForTileGid(obj.tile.gid); let sourceRect = tileset.tileRegions[obj.tile.gid]; pos.y -= obj.tile.tilesetTile.image.height; - // TODO: draw + + if (!obj.tile.tilesetTile.image.bitmap) + container.addChild(obj.tile.tilesetTile.image.bitmap); + obj.tile.tilesetTile.image.bitmap.x = pos.x; + obj.tile.tilesetTile.image.bitmap.y = pos.y; + obj.tile.tilesetTile.image.bitmap.filters = []; + obj.tile.tilesetTile.image.bitmap.rotation = 0; + obj.tile.tilesetTile.image.bitmap.scaleX = scale.x; + obj.tile.tilesetTile.image.bitmap.scaleY = scale.y; break; case TmxObjectType.ellipse: pos = new Vector2(obj.x + obj.width * 0.5, obj.y + obj.height * 0.5).multiply(scale); - // TODO: draw + if (!obj.shape.parent) + container.addChild(obj.shape); + DrawUtils.drawCircle(obj.shape, pos, obj.width * 0.5, objGroup.color); break; case TmxObjectType.polygon: case TmxObjectType.polyline: let points = []; for (let i = 0; i < obj.points.length; i++) points[i] = Vector2.multiply(obj.points[i], scale); - // TODO: draw + DrawUtils.drawPoints(obj.shape, pos, points, objGroup.color, obj.objectType == TmxObjectType.polygon); break; case TmxObjectType.text: - // TODO: draw + if (!obj.textField.parent) + container.addChild(obj.textField); + DrawUtils.drawString(obj.textField, obj.text.value, pos, obj.text.color, MathHelper.toRadians(obj.rotation), + Vector2.zero, 1); break; default: - // TODO: debug draw + if (Core.debugRenderEndabled){ + if (!obj.textField.parent) + container.addChild(obj.textField); + DrawUtils.drawString(obj.textField, `${obj.name}(${obj.type})`, Vector2.subtract(pos, new Vector2(0, 15)), 0xffffff, 0, Vector2.zero, 1); + } break; } } } - public static renderGroup(group: TmxGroup, position: Vector2, scale: Vector2, layerDepth: number) { + public static renderGroup(group: TmxGroup, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, layerDepth: number) { if (!group.visible) return; group.layers.forEach(layer => { if (layer instanceof TmxGroup) { - this.renderGroup(layer, position, scale, layerDepth); + this.renderGroup(layer, container, position, scale, layerDepth); } if (layer instanceof TmxObjectGroup) { - this.renderObjectGroup(layer, position, scale,layerDepth); + this.renderObjectGroup(layer, container, position, scale, layerDepth); } - if (layer instanceof TmxLayer){ - this.renderLayer(layer, position, scale, layerDepth); + if (layer instanceof TmxLayer) { + this.renderLayer(layer, container, position, scale, layerDepth); } - if (layer instanceof TmxImageLayer){ - this.renderImageLayer(layer, position, scale, layerDepth); + if (layer instanceof TmxImageLayer) { + this.renderImageLayer(layer, container, position, scale, layerDepth); } }); } - public static renderTile(tile: TmxLayerTile, position: Vector2, scale: Vector2, tileWidth: number, tileHeight: number, color: Color, layerDepth: number) { + public static renderTile(tile: TmxLayerTile, container: egret.DisplayObjectContainer, position: Vector2, scale: Vector2, tileWidth: number, tileHeight: number, color: egret.ColorMatrixFilter, layerDepth: number) { let gid = tile.gid; // 动画tiles(以及来自图像tile的tiles)将位于Tileset本身内,位于单独的TmxTilesetTile对象中,不要与我们在此循环中处理的TmxLayerTiles混淆 @@ -153,9 +188,23 @@ module es { let pos = new Vector2(tx, ty).add(position); if (tile.tileset.image) { - // TODO: draw + if (!tile.tilesetTile.image.bitmap.parent) + container.addChild(tile.tilesetTile.image.bitmap); + tile.tilesetTile.image.bitmap.x = pos.x; + tile.tilesetTile.image.bitmap.y = pos.y; + tile.tilesetTile.image.bitmap.scaleX = scale.x; + tile.tilesetTile.image.bitmap.scaleY = scale.y; + tile.tilesetTile.image.bitmap.rotation = rotation; + tile.tilesetTile.image.bitmap.filters = [color]; } else { - // TODO: draw + if (!tilesetTile.image.bitmap) + container.addChild(tilesetTile.image.bitmap); + tilesetTile.image.bitmap.x = pos.x; + tilesetTile.image.bitmap.y = pos.y; + tilesetTile.image.bitmap.scaleX = scale.x; + tilesetTile.image.bitmap.scaleY = scale.y; + tilesetTile.image.bitmap.rotation = rotation; + tilesetTile.image.bitmap.filters = [color]; } } } diff --git a/source/src/Tiled/Tileset.ts b/source/src/Tiled/Tileset.ts index c7b83a96..d4a1c45d 100644 --- a/source/src/Tiled/Tileset.ts +++ b/source/src/Tiled/Tileset.ts @@ -13,7 +13,7 @@ module es { public tileOffset: TmxTileOffset; public properties: Map; public image: TmxImage; - public terrains: TmxList; + public terrains: TmxTerrain[]; /** * 为每个块缓存源矩形 */ diff --git a/source/src/Tiled/TilesetTile.ts b/source/src/Tiled/TilesetTile.ts index 90ddc28b..a6764f62 100644 --- a/source/src/Tiled/TilesetTile.ts +++ b/source/src/Tiled/TilesetTile.ts @@ -7,7 +7,7 @@ module es { public type: string; public properties: Map; public image: TmxImage; - public objectGroups: TmxList; + public objectGroups: TmxObjectGroup[]; public animationFrames: TmxAnimationFrame[]; // TODO: 为什么动画瓷砖需要添加firstGid diff --git a/source/src/Tiled/TmxUtils.ts b/source/src/Tiled/TmxUtils.ts new file mode 100644 index 00000000..3ff273c4 --- /dev/null +++ b/source/src/Tiled/TmxUtils.ts @@ -0,0 +1,50 @@ +module es { + export class TmxUtils { + /** + * 解码 + * @param data 数据 + * @param encoding 编码方式 目前暂时只支持XML、base64(无压缩)、csv解析 + * @param compression 压缩方式 + * @returns 返回解析后的数据列表 + * + * @version Egret 3.0.3 + */ + static decode(data: any, encoding: any, compression: string): Array { + compression = compression || "none"; + encoding = encoding || "none"; + var text:string=data.children[0].text; + switch (encoding) { + case "base64": + var decoded = Base64Utils.decodeBase64AsArray(text, 4); + return (compression === "none") ? decoded : Base64Utils.decompress(text, decoded, compression); + + case "csv": + return Base64Utils.decodeCSV(text); + + case "none": + var datas: Array = []; + for (var i: number = 0; i < data.children.length; i++) { + datas[i] = +data.children[i].attributes.gid; + } + return datas; + + default: + throw new Error("未定义的编码:" + encoding); + } + } + + + /** + * 将带"#"号的颜色字符串转换为16进制的颜色,例如:可将"#ff0000"转换为"0xff0000" + * @param $color 要转换的颜色字符串 + * @returns 返回16进制的颜色值 + * @version Egret 3.0.3 + */ + static color16ToUnit($color:string): number { + if (!$color) + return 0x000000; + var colorStr: string = "0x" + $color.slice(1); + return parseInt(colorStr, 16); + } + } +} \ No newline at end of file diff --git a/source/src/Utils/Base64Utils.ts b/source/src/Utils/Base64Utils.ts index 5586731d..1259a9c2 100644 --- a/source/src/Utils/Base64Utils.ts +++ b/source/src/Utils/Base64Utils.ts @@ -1,124 +1,134 @@ -class Base64Utils { - private static _keyNum = "0123456789+/"; - private static _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; - private static _keyAll = Base64Utils._keyNum + Base64Utils._keyStr; - /** - * 加密 - * @param input - */ - public static encode = function (input) { - let output = ""; - let chr1, chr2, chr3, enc1, enc2, enc3, enc4; - let i = 0; - input = this._utf8_encode(input); - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - output = output + - this._keyAll.charAt(enc1) + this._keyAll.charAt(enc2) + - this._keyAll.charAt(enc3) + this._keyAll.charAt(enc4); - } - return this._keyStr.charAt(Math.floor((Math.random() * this._keyStr.length))) + output; - }; +module es{ + export class Base64Utils { + private static _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - /** - * 解码 - * @param input - * @param isNotStr - */ - public static decode(input, isNotStr: boolean = true) { - let output = ""; - let chr1, chr2, chr3; - let enc1, enc2, enc3, enc4; - let i = 0; - input = this.getConfKey(input); - input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - while (i < input.length) { - enc1 = this._keyAll.indexOf(input.charAt(i++)); - enc2 = this._keyAll.indexOf(input.charAt(i++)); - enc3 = this._keyAll.indexOf(input.charAt(i++)); - enc4 = this._keyAll.indexOf(input.charAt(i++)); - chr1 = (enc1 << 2) | (enc2 >> 4); - chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); - chr3 = ((enc3 & 3) << 6) | enc4; - output = output + String.fromCharCode(chr1); - if (enc3 != 64) { - if (chr2 == 0) { - if (isNotStr) output = output + String.fromCharCode(chr2); - } else { - output = output + String.fromCharCode(chr2); - } - } - - if (enc4 != 64) { - if (chr3 == 0) { - if (isNotStr) output = output + String.fromCharCode(chr3); - } else { - output = output + String.fromCharCode(chr3); + /** + * 判断是否原生支持Base64位解析 + */ + static get nativeBase64() { + return (typeof (window.atob) === "function"); + } + + + /** + * 解码 + * @param input + */ + static decode(input:string): string { + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + if (this.nativeBase64) { + return window.atob(input); + } else { + var output: any = [], chr1: number, chr2: number, chr3: number, enc1: number, enc2: number, enc3: number, enc4: number, i: number = 0; + + while (i < input.length) { + enc1 = this._keyStr.indexOf(input.charAt(i++)); + enc2 = this._keyStr.indexOf(input.charAt(i++)); + enc3 = this._keyStr.indexOf(input.charAt(i++)); + enc4 = this._keyStr.indexOf(input.charAt(i++)); + + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + output.push(String.fromCharCode(chr1)); + + if (enc3 !== 64) { + output.push(String.fromCharCode(chr2)); + } + if (enc4 !== 64) { + output.push(String.fromCharCode(chr3)); + } + } + + output = output.join(""); + return output; + } + } + + + /** + * 编码 + * @param input + */ + static encode(input:string): string { + input = input.replace(/\r\n/g, "\n"); + if (this.nativeBase64) { + window.btoa(input); + } else { + var output: any = [], chr1: number, chr2: number, chr3: number, enc1: number, enc2: number, enc3: number, enc4: number, i: number = 0; + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output.push(this._keyStr.charAt(enc1)); + output.push(this._keyStr.charAt(enc2)); + output.push(this._keyStr.charAt(enc3)); + output.push(this._keyStr.charAt(enc4)); + } + + output = output.join(""); + return output; + } + } + + + /** + * 解析Base64格式数据 + * @param input + * @param bytes + */ + static decodeBase64AsArray(input: string, bytes: number): Uint32Array { + bytes = bytes || 1; + + var dec = Base64Utils.decode(input), i, j, len; + var ar: Uint32Array = new Uint32Array(dec.length / bytes); + + for (i = 0, len = dec.length / bytes; i < len; i++) { + ar[i] = 0; + for (j = bytes - 1; j >= 0; --j) { + ar[i] += dec.charCodeAt((i * bytes) + j) << (j << 3); } } + return ar; } - output = this._utf8_decode(output); - return output; - } - - private static _utf8_encode(string) { - string = string.replace(/\r\n/g, "\n"); - let utftext = ""; - for (let n = 0; n < string.length; n++) { - let c = string.charCodeAt(n); - if (c < 128) { - utftext += String.fromCharCode(c); - } else if ((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } + /** + * 暂时不支持 + * @param data + * @param decoded + * @param compression + * @private + */ + static decompress(data: string, decoded: any, compression: string): any { + throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!"); } - return utftext; - } - private static _utf8_decode(utftext) { - let string = ""; - let i = 0; - let c = 0; - let c1 = 0; - let c2 = 0; - let c3 = 0; - while (i < utftext.length) { - c = utftext.charCodeAt(i); - if (c < 128) { - string += String.fromCharCode(c); - i++; - } else if ((c > 191) && (c < 224)) { - c2 = utftext.charCodeAt(i + 1); - string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); - i += 2; - } else { - c2 = utftext.charCodeAt(i + 1); - c3 = utftext.charCodeAt(i + 2); - string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); - i += 3; + /** + * 解析csv数据 + * @param input + */ + static decodeCSV(input: string): Array { + var entries: Array = input.replace("\n", "").trim().split(","); + + var result:Array = []; + for (var i:number = 0; i < entries.length; i++) { + result.push(+entries[i]); } + return result; } - return string; } - - private static getConfKey(key): string { - return key.slice(1, key.length); - } -} \ No newline at end of file +} diff --git a/source/src/Utils/DrawUtils.ts b/source/src/Utils/DrawUtils.ts index 14332ad5..efcfae7e 100644 --- a/source/src/Utils/DrawUtils.ts +++ b/source/src/Utils/DrawUtils.ts @@ -5,6 +5,29 @@ module es { this.drawLineAngle(shape, start, MathHelper.angleBetweenVectors(start, end), Vector2.distance(start, end), color, thickness); } + public static drawCircle(shape: egret.Shape, position: Vector2, radius: number, color: number){ + shape.graphics.beginFill(color); + shape.graphics.drawCircle(position.x, position.y, radius); + shape.graphics.endFill(); + } + + public static drawPoints(shape: egret.Shape, position: Vector2, points: Vector2[], color: number, + closePoly: boolean = true, thickness: number = 1){ + if (points.length < 2) + return; + + for (let i = 1; i < points.length; i ++) + this.drawLine(shape, Vector2.add(position, points[i - 1]), Vector2.add(position, points[i]), color, thickness); + + if (closePoly) + this.drawLine(shape, Vector2.add(position, points[points.length - 1]), Vector2.add(position, points[0]), color, thickness); + } + + public static drawString(textField: egret.TextField, text: string, position: Vector2, color: number, rotation: number, + origin: Vector2, scale: number){ + + } + public static drawLineAngle(shape: egret.Shape, start: Vector2, radians: number, length: number, color: number, thickness = 1) { shape.graphics.beginFill(color); shape.graphics.drawRect(start.x, start.y, 1, 1);