Class QuestRequirement<O, D>
Type Parameters
-
O extends any[] = []
-
D extends {} = {}
Constructors
constructor
- new QuestRequirement<O, D>(defaultData: D): QuestRequirement<O, D>
-
Type Parameters
-
O extends any[] = []
-
D extends {} = {}
Properties
Readonly
defaultData
defaultData: D
Methods
getCompletionAmount
- getCompletionAmount(api: IQuestRequirementApi<O, D>): number
-
Returns number
getEventBusTriggers
- getEventBusTriggers(): Stream<readonly [EmitterOrBus, string | number | symbol, ((api: IQuestRequirementApi<O, D>, ...args: any[]) => boolean)]>
-
Returns Stream<readonly [EmitterOrBus, string | number | symbol, ((api: IQuestRequirementApi<O, D>, ...args: any[]) => boolean)]>
getInitializeTrigger
- getInitializeTrigger(): undefined | ((api: IQuestRequirementApi<O, D>) => boolean)
-
Returns undefined | ((api: IQuestRequirementApi<O, D>) => boolean)
setCompletionAmountGetter
setEventTrigger
- setEventTrigger<E, K>(bus: E, event: K, checker: ((api: IQuestRequirementApi<O, D>, ...args: [host: HostFromHostOrHostClass<E extends EventBus ? ReturnType<{
0(): default<any, any, any, any, any>;
1(): default;
10(): default<any>;
11(): Game;
12(): default<number>;
13(): default;
14(): default;
15(): default;
16(): default;
17(): default.Events;
18(): default;
19(): default;
2(): default;
20(): MilestoneManager;
21(): default;
22(): default;
23(): default;
24(): default;
25(): default;
26(): default;
27(): default.Events;
28(): default;
29(): default;
3(): default;
30(): default;
31(): default;
32(): default;
33(): Ui;
34(): default;
35(): default;
36(): default;
4(): default;
5(): default;
6(): default;
7(): default;
8(): default<unknown, number, unknown, unknown>;
9(): default<unknown, number, unknown, unknown>;
}[E]> : E>, ...args: Extract<LiterallyJustTheSameThing<Parameters<Extract<Extract<Events<E extends EventBus ? ReturnType<{
0(): default<any, any, any, any, any>;
1(): default;
10(): default<any>;
11(): Game;
12(): default<number>;
13(): default;
14(): default;
15(): default;
16(): default;
17(): default.Events;
18(): default;
19(): default;
2(): default;
20(): MilestoneManager;
21(): default;
22(): default;
23(): default;
24(): default;
25(): default;
26(): default;
27(): default.Events;
28(): default;
29(): default;
3(): default;
30(): default;
31(): default;
32(): default;
33(): Ui;
34(): default;
35(): default;
36(): default;
4(): default;
5(): default;
6(): default;
7(): default;
8(): default<unknown, number, unknown, unknown>;
9(): default<unknown, number, unknown, unknown>;
}[E]> : E>[K], AnyFunction<any>>, AnyFunction<any>>>>, any[]>[]]) => boolean)): QuestRequirement<O, D>
-
Type Parameters
-
-
K extends string | number | symbol
Parameters
-
bus: E
-
event: K
-
-
- (api: IQuestRequirementApi<O, D>, ...args: [host: HostFromHostOrHostClass<E extends EventBus ? ReturnType<{
0(): default<any, any, any, any, any>;
1(): default;
10(): default<any>;
11(): Game;
12(): default<number>;
13(): default;
14(): default;
15(): default;
16(): default;
17(): default.Events;
18(): default;
19(): default;
2(): default;
20(): MilestoneManager;
21(): default;
22(): default;
23(): default;
24(): default;
25(): default;
26(): default;
27(): default.Events;
28(): default;
29(): default;
3(): default;
30(): default;
31(): default;
32(): default;
33(): Ui;
34(): default;
35(): default;
36(): default;
4(): default;
5(): default;
6(): default;
7(): default;
8(): default<unknown, number, unknown, unknown>;
9(): default<unknown, number, unknown, unknown>;
}[E]> : E>, ...args: Extract<LiterallyJustTheSameThing<Parameters<Extract<Extract<Events<E extends EventBus ? ReturnType<{
0(): default<any, any, any, any, any>;
1(): default;
10(): default<any>;
11(): Game;
12(): default<number>;
13(): default;
14(): default;
15(): default;
16(): default;
17(): default.Events;
18(): default;
19(): default;
2(): default;
20(): MilestoneManager;
21(): default;
22(): default;
23(): default;
24(): default;
25(): default;
26(): default;
27(): default.Events;
28(): default;
29(): default;
3(): default;
30(): default;
31(): default;
32(): default;
33(): Ui;
34(): default;
35(): default;
36(): default;
4(): default;
5(): default;
6(): default;
7(): default;
8(): default<unknown, number, unknown, unknown>;
9(): default<unknown, number, unknown, unknown>;
}[E]> : E>[K], AnyFunction<any>>, AnyFunction<any>>>>, any[]>[]]): boolean
-
Returns boolean
setHostTrigger
- setHostTrigger<E>(event: E, checker: ((api: IQuestRequirementApi<O, D>, player: default, ...args: Extract<LiterallyJustTheSameThing<Parameters<Extract<IPlayerEvents[E], AnyFunction<any>>>>, any[]>) => boolean)): QuestRequirement<O, D>
-
Parameters
-
event: E
-
checker: ((api: IQuestRequirementApi<O, D>, player: default, ...args: Extract<LiterallyJustTheSameThing<Parameters<Extract<IPlayerEvents[E], AnyFunction<any>>>>, any[]>) => boolean)
-
- (api: IQuestRequirementApi<O, D>, player: default, ...args: Extract<LiterallyJustTheSameThing<Parameters<Extract<IPlayerEvents[E], AnyFunction<any>>>>, any[]>): boolean
-
Parameters
-
-
-
Rest
...args: Extract<LiterallyJustTheSameThing<Parameters<Extract<IPlayerEvents[E], AnyFunction<any>>>>, any[]>
Returns boolean
Protected
validateOptions
- validateOptions(...options: O): boolean
-
Returns boolean