var TOWER_PARAMS = { 0: [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 1: [ 50, 201, 5, 0, 0, 201, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 2: [ 1000, 201, 2, 0, 0, 201, 4, 1, 0, 201, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 3: [ 2500, 202, 2, 1, 0, 201, 4, 0, 0, 203, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 4: [ 4000, 205, 4, 0, 0, 201, 6, 1, 0, 205, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 11: [ 800, 201, 5, 0, 0, 201, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 21: [ 1500, 201, 2, 1, 0, 202, 4, 1, 0, 203, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 22: [ 2000, 202, 4, 0, 0, 201, 6, 1, 0, 202, 8, 0, 0, 201, 3, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ], 31: [ 1000, 201, 3, 0, 0, 201, 4, 1, 0, 202, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], 41: [ 500, 201, 3, 0, 0, 201, 4, 1, 0, 211, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], }; var CASTLE_HP_RATE = 1; var StageParam = /** @class */ (function () { function StageParam(stageId) { this.towerList = []; this.stageId = stageId; } StageParam.prototype.pushTower = function (tower) { this.towerList.push(tower); }; return StageParam; })(); var TowerDirection; (function (TowerDirection) { TowerDirection[(TowerDirection["left"] = 0)] = "left"; TowerDirection[(TowerDirection["right"] = 1)] = "right"; })(TowerDirection || (TowerDirection = {})); var TowerParam = /** @class */ (function () { function TowerParam(towerId, x, y, d) { this.towerId = towerId; this.x = x; this.y = y; this.d = d; } return TowerParam; })(); function getTowerParam(stageId) { var param = TOWER_PARAMS[stageId]; if (!param) { console.error(stageId + " の TowerParam が見つかりません"); return null; } var stageParam = new StageParam(stageId); stageParam.castleHp = Math.round(param[0] * CASTLE_HP_RATE); var start = 1; for (var i = 0; i < 6; i++) { var index = start + i * 4; if (param[index] == 0) { break; } var tower = new TowerParam( param[index], param[index + 1], param[index + 2], param[index + 3] ); stageParam.pushTower(tower); } return stageParam; }