2021-08-21 12:45:58 -05:00
|
|
|
/// <reference path="./IResource.ts" />
|
|
|
|
|
2021-08-21 19:02:57 -05:00
|
|
|
abstract class Passive implements IResource {
|
2021-09-05 15:02:50 -05:00
|
|
|
public readonly resourceType = ResourceType.passive;
|
|
|
|
public readonly valueInWholeNumbers = false;
|
2021-09-04 22:21:14 -05:00
|
|
|
public value = 0;
|
2021-08-22 11:51:16 -05:00
|
|
|
|
2021-09-05 19:20:24 -05:00
|
|
|
public advanceAction?: (time: number, state: GameState) => void = undefined;
|
2021-08-21 12:45:58 -05:00
|
|
|
|
2021-09-06 12:02:38 -05:00
|
|
|
constructor(
|
2021-09-06 08:51:41 -05:00
|
|
|
public readonly label: string,
|
2021-09-06 00:12:05 -05:00
|
|
|
public readonly singularName: string,
|
|
|
|
public readonly pluralName: string,
|
2021-08-22 11:51:16 -05:00
|
|
|
public readonly description: string
|
2021-09-06 12:02:38 -05:00
|
|
|
) {}
|
2021-08-22 11:51:16 -05:00
|
|
|
|
2021-09-06 12:02:38 -05:00
|
|
|
public addValue(amount: number, _state: GameState): void {
|
2021-08-22 11:51:16 -05:00
|
|
|
this.value += amount;
|
2021-08-21 12:45:58 -05:00
|
|
|
}
|
|
|
|
|
2021-09-06 12:02:38 -05:00
|
|
|
public isUnlocked(_state: GameState): boolean {
|
2021-08-21 12:45:58 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|