This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
irreligious/src/model/resource/BuildingPermit.ts

19 lines
562 B
TypeScript

/// <reference path="./Research.ts" />
class BuildingPermit extends Research {
constructor (config: GameConfig) {
super('Building Permit',
'Unlocks several new buildings you can build outside of your compounds.');
this.cost.money = config.cfgBuildingPermitCost;
}
public isUnlocked (state: GameState): boolean {
if (this._isUnlocked) return true;
const compounds = state.getResource(ResourceKey.compounds);
if (compounds !== null && compounds.value > 0) {
this._isUnlocked = true;
}
return this._isUnlocked;
}
}