migrate from perforce
This commit is contained in:
2
dist/Simulation/Commands/ISimCommand.js
vendored
Normal file
2
dist/Simulation/Commands/ISimCommand.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=ISimCommand.js.map
|
||||
1
dist/Simulation/Commands/ISimCommand.js.map
vendored
Normal file
1
dist/Simulation/Commands/ISimCommand.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ISimCommand.js","sourceRoot":"","sources":["../../../src/Simulation/Commands/ISimCommand.ts"],"names":[],"mappings":""}
|
||||
27
dist/Simulation/Commands/SimCommandBlockTerrain.js
vendored
Normal file
27
dist/Simulation/Commands/SimCommandBlockTerrain.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Hex } from "../../Util/index.js";
|
||||
import { ECellType } from "../index.js";
|
||||
export class SimCommandBlockTerrain {
|
||||
_hex;
|
||||
_simLevel;
|
||||
constructor(level, hex) {
|
||||
this._hex = hex;
|
||||
this._simLevel = level;
|
||||
}
|
||||
execute() {
|
||||
const simLevel = this._simLevel;
|
||||
const cellIndex = simLevel.getCellIndex(this._hex);
|
||||
const cell = simLevel.simCells[cellIndex];
|
||||
if (cell.type != ECellType.Free || cell.simTower != null || !simLevel.reservePaths(this._hex)) {
|
||||
return;
|
||||
}
|
||||
cell.type = ECellType.Blocked;
|
||||
simLevel.updateBlockedType(cell);
|
||||
for (let i = 0; i < 6; ++i) {
|
||||
const neighbourHex = Hex.neighbour(cell.hex, i);
|
||||
const neighbourIndex = simLevel.getCellIndex(neighbourHex);
|
||||
simLevel.updateBlockedType(simLevel.simCells[neighbourIndex]);
|
||||
}
|
||||
simLevel.updatePaths();
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SimCommandBlockTerrain.js.map
|
||||
1
dist/Simulation/Commands/SimCommandBlockTerrain.js.map
vendored
Normal file
1
dist/Simulation/Commands/SimCommandBlockTerrain.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"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AAC;QACD,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC3B,CAAC;CACJ"}
|
||||
42
dist/Simulation/Commands/SimCommandCreateTower.js
vendored
Normal file
42
dist/Simulation/Commands/SimCommandCreateTower.js
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { Hex } from "../../Util/index.js";
|
||||
import { ECellType, SimTower } from "../index.js";
|
||||
export class SimCommandCreateTower {
|
||||
_hex;
|
||||
_simLevel;
|
||||
_index;
|
||||
_gdRoot;
|
||||
constructor(game, level, hex, index) {
|
||||
this._gdRoot = game;
|
||||
this._hex = hex;
|
||||
this._simLevel = level;
|
||||
this._index = index;
|
||||
}
|
||||
execute() {
|
||||
const level = this._simLevel;
|
||||
const cellIndex = level.getCellIndex(this._hex);
|
||||
const cell = level.simCells[cellIndex];
|
||||
const towerData = this._gdRoot.towers[this._index];
|
||||
if (cell.type != ECellType.Free) {
|
||||
return;
|
||||
}
|
||||
if (cell.simTower != null) {
|
||||
return;
|
||||
}
|
||||
level.simEnemies.forEach((enemy) => {
|
||||
const hex = Hex.fromWorld(enemy.position);
|
||||
const enemyCellIndex = level.getCellIndex(hex);
|
||||
if (cellIndex == enemyCellIndex) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
if (level.currency < towerData.cost) {
|
||||
return;
|
||||
}
|
||||
if (level.reservePaths(this._hex)) {
|
||||
level.currency -= towerData.cost;
|
||||
cell.simTower = new SimTower(this._gdRoot, level, this._index, this._hex);
|
||||
level.updatePaths();
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SimCommandCreateTower.js.map
|
||||
1
dist/Simulation/Commands/SimCommandCreateTower.js.map
vendored
Normal file
1
dist/Simulation/Commands/SimCommandCreateTower.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SimCommandCreateTower.js","sourceRoot":"","sources":["../../../src/Simulation/Commands/SimCommandCreateTower.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,qB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EAAE,CAAC;YAClC,OAAO;QACX,CAAC;QAED,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,KAAK,CAAC,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1E,KAAK,CAAC,WAAW,EAAE,CAAC;QACxB,CAAC;IACL,CAAC;CACJ"}
|
||||
21
dist/Simulation/Commands/SimCommandStartNextWave.js
vendored
Normal file
21
dist/Simulation/Commands/SimCommandStartNextWave.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
export class SimCommandStartNextWave {
|
||||
_simLevel;
|
||||
_gdRoot;
|
||||
constructor(gdRoot, level) {
|
||||
this._gdRoot = gdRoot;
|
||||
this._simLevel = level;
|
||||
}
|
||||
execute() {
|
||||
const level = this._simLevel;
|
||||
const data = level.gdLevel;
|
||||
level.currentWave += 1;
|
||||
if (!data.waves[level.currentWave]) {
|
||||
level.paused = true;
|
||||
return;
|
||||
}
|
||||
level.nextWaveStep = level.currentStep + this._gdRoot.simulation.waveDuration * this._gdRoot.simulation.stepsPerSecond - 1;
|
||||
level.lastEnemySpawnStep = level.currentStep;
|
||||
level.enemiesLeftToSpawn = data.waves[level.currentWave].amount;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=SimCommandStartNextWave.js.map
|
||||
1
dist/Simulation/Commands/SimCommandStartNextWave.js.map
vendored
Normal file
1
dist/Simulation/Commands/SimCommandStartNextWave.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"SimCommandStartNextWave.js","sourceRoot":"","sources":["../../../src/Simulation/Commands/SimCommandStartNextWave.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,uBAAuB;IACxB,SAAS,CAAW;IACpB,OAAO,CAAS;IAExB,YAAY,MAAc,EAAE,KAAe;QACvC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,OAAO;QACH,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;QAC3B,KAAK,CAAC,WAAW,IAAI,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;YACjC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;YACpB,OAAO;QACX,CAAC;QACD,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,GAAG,CAAC,CAAC;QAC3H,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC;QAC7C,KAAK,CAAC,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;IACpE,CAAC;CACJ"}
|
||||
Reference in New Issue
Block a user