migrate from perforce
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user