fix remaining typescript errors

This commit is contained in:
2023-03-25 02:07:05 +01:00
parent 31bf1d8b8f
commit 247a87b41c
6 changed files with 23 additions and 9 deletions
+7
View File
@@ -3,10 +3,13 @@ export class Guild {
level: number;
displayUpgradeCost: number|string;
upgradeCost: number|null = null;
constructor(level: number, gold: number) {
this.gold = gold;
this.level = level;
this.displayUpgradeCost = this.getUpgradeCost() ?? "Max level";
this.upgradeCost = this.getUpgradeCost();
}
upgrade(): void {
@@ -27,6 +30,10 @@ export class Guild {
getUpgradeCost(): number|null {
return upgradeCosts[this.level] ?? null;
}
isMaxLevel(): boolean {
return this.level >= 7;
}
}
const upgradeCosts = {