Add optional total functions to BonusDecorator options

This commit is contained in:
Seth Posner 2023-04-19 16:59:52 -07:00
parent f79359b18a
commit 7065de519f
3 changed files with 2854 additions and 2091 deletions

4941
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,9 +6,11 @@ import { Decorator } from "./common";
export interface BonusAmountFeatureOptions { export interface BonusAmountFeatureOptions {
bonusAmount: Computable<DecimalSource>; bonusAmount: Computable<DecimalSource>;
totalAmount?: Computable<DecimalSource>;
} }
export interface BonusCompletionsFeatureOptions { export interface BonusCompletionsFeatureOptions {
bonusCompletions: Computable<DecimalSource>; bonusCompletions: Computable<DecimalSource>;
totalCompletions?: Computable<DecimalSource>;
} }
export interface BaseBonusAmountFeature { export interface BaseBonusAmountFeature {

View file

@ -2,7 +2,7 @@ import { Replace, OptionsObject } from "../feature";
import { Computable, GetComputableType, processComputable, ProcessedComputable } from "util/computed"; import { Computable, GetComputableType, processComputable, ProcessedComputable } from "util/computed";
import { Persistent, State } from "game/persistence"; import { Persistent, State } from "game/persistence";
export type Decorator<FeatureOptions, BaseFeature = {}, GenericFeature = {}, S extends State = State> = { export type Decorator<FeatureOptions, BaseFeature = {}, GenericFeature = BaseFeature, S extends State = State> = {
getPersistentData?(): Record<string, Persistent<S>>; getPersistentData?(): Record<string, Persistent<S>>;
preConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): void; preConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): void;
postConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): void; postConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): void;