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
Raw Normal View History

/// <reference path="./SharedTypes.ts" />
2021-09-05 20:43:11 -05:00
interface IResource {
readonly resourceType: ResourceType;
2021-09-06 08:51:41 -05:00
readonly label?: string;
readonly singularName: string;
readonly pluralName: string;
2021-09-05 14:45:37 -05:00
readonly description: string;
readonly valueInWholeNumbers: boolean;
2021-09-05 19:20:24 -05:00
readonly value: number;
2021-09-05 20:43:11 -05:00
readonly cost?: ResourceNumber;
2021-09-05 19:20:24 -05:00
max?: (state: GameState) => number;
inc?: (state: GameState) => number;
advanceAction?: (time: number, state: GameState) => void;
userActions?: ResourceAction[];
2021-09-05 19:20:24 -05:00
2021-09-05 14:45:37 -05:00
addValue: (amount: number, state: GameState) => void;
isUnlocked: (state: GameState) => boolean;
emitConfig?: () => { [key: string]: string | number | boolean };
restoreConfig?: (config: {
[key: string]: string | number | boolean;
}) => void;
}