Enable strictPropertyInitialization (#1909)

## Description:

Enable the tsconfig option `strictPropertyInitialization`.

Fixes #1907

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
This commit is contained in:
Scott Anderson
2025-08-23 19:21:40 -04:00
committed by GitHub
parent f5316cc378
commit 51519b0b9d
76 changed files with 599 additions and 367 deletions
+7 -3
View File
@@ -5,11 +5,11 @@ import { TileRef } from "../game/GameMap";
export class ShellExecution implements Execution {
private active = true;
private pathFinder: AirPathFinder;
private pathFinder: AirPathFinder | undefined;
private shell: Unit | undefined;
private mg: Game;
private mg: Game | undefined;
private destroyAtTick = -1;
private random: PseudoRandom;
private random: PseudoRandom | undefined;
constructor(
private readonly spawn: TileRef,
@@ -25,6 +25,8 @@ export class ShellExecution implements Execution {
}
tick(ticks: number): void {
if (this.mg === undefined) throw new Error("Not initialized");
if (this.pathFinder === undefined) throw new Error("Not initialized");
this.shell ??= this._owner.buildUnit(UnitType.Shell, this.spawn, {});
if (!this.shell.isActive()) {
this.active = false;
@@ -62,6 +64,8 @@ export class ShellExecution implements Execution {
}
private effectOnTarget(): number {
if (this.mg === undefined) throw new Error("Not initialized");
if (this.random === undefined) throw new Error("Not initialized");
const { damage } = this.mg.config().unitInfo(UnitType.Shell);
const baseDamage = damage ?? 250;