This commit is contained in:
Olivier Gagnon
2021-08-19 16:37:59 -04:00
parent ee3530d9b9
commit df457a0c6e
18 changed files with 194 additions and 105 deletions

View File

@@ -44,8 +44,6 @@ export class HashUpgrade {
// The meaning varies between different upgrades
value = 0;
effectText: (level: number) => JSX.Element | null = () => null;
constructor(p: IConstructorParams) {
if (p.cost != null) { this.cost = p.cost; }
if (p.effectText != null) { this.effectText = p.effectText; }
@@ -57,6 +55,9 @@ export class HashUpgrade {
this.value = p.value;
}
// Functions that returns the UI element to display the effect of this upgrade.
effectText: (level: number) => JSX.Element | null = () => null;
getCost(levels: number): number {
if (typeof this.cost === "number") { return this.cost; }