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/CompoundManager.ts

28 lines
746 B
TypeScript

/// <reference path="./Job.ts" />
class CompoundManager extends Job {
public readonly resourceKey = ResourceKey.compoundManagers;
constructor() {
super(
'Compound Managers',
'compound manager',
'compound managers',
'Automatically purchase tents, houses, and churches when money and compound space permits.'
);
}
public max = (state: GameState): number => {
return (
(state.resource.compounds?.value ?? 0) *
(state.config.cfgCapacity.compounds?.compoundManagers ?? 0)
);
};
public isUnlocked = (state: GameState): boolean => {
if (this._isUnlocked) return true;
this._isUnlocked = state.resource.compounds?.isUnlocked(state) === true;
return this._isUnlocked;
};
}