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

27 lines
761 B
TypeScript

/// <reference path="./SharedTypes.ts" />
interface IResource {
readonly resourceType: ResourceType;
readonly label?: string;
readonly singularName: string;
readonly pluralName: string;
readonly description: string;
readonly valueInWholeNumbers: boolean;
readonly value: number;
readonly cost?: ResourceNumber;
max?: (state: GameState) => number;
inc?: (state: GameState) => number;
advanceAction?: (time: number, state: GameState) => void;
userActions?: ResourceAction[];
addValue: (amount: number, state: GameState) => void;
isUnlocked: (state: GameState) => boolean;
emitConfig?: () => { [key: string]: string | number | boolean };
restoreConfig?: (config: {
[key: string]: string | number | boolean;
}) => void;
}