"use strict"; cc._RF.push(module, '36916S7pdxLn4M1CKK44z9T', 'BombBlockData'); // scripts/kernel/battle/map/BombBlockData.ts "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.BombBlockData = void 0; var BlockData_1 = require("./BlockData"); var BombBlockData = /** @class */ (function (_super) { __extends(BombBlockData, _super); function BombBlockData() { return _super !== null && _super.apply(this, arguments) || this; } //#region life cycle BombBlockData.prototype.onDead = function () { _super.prototype.onDead.call(this); var startX = cc.clamp(this.gridPos.x - 1, 0, this.map.mapGridSize.x - 1); var endX = cc.clamp(this.gridPos.x + 1, 0, this.map.mapGridSize.x - 1); var startY = cc.clamp(this.gridPos.y - 1, 0, this.map.mapGridSize.y - 1); var endY = cc.clamp(this.gridPos.y + 1, 0, this.map.mapGridSize.y - 1); for (var x = startX; x <= endX; ++x) { for (var y = startY; y <= endY; ++y) { if (x == this.gridPos.x && y == this.gridPos.y) { continue; } var block = this.map.getBlockByGridPos(x, y); //消除周围的格子 if (block) { block.dead(); } } } }; return BombBlockData; }(BlockData_1.BlockData)); exports.BombBlockData = BombBlockData; cc._RF.pop();