UNPKG

@civ-clone/core-rule

Version:

This component contains the framework for `Rule`s. These are comprised of `Criterion`s and `Effect`s with optional `Priority`s.

18 lines (13 loc) 330 B
export interface IEffect { apply(...args: any[]): any; } export class Effect<T extends any[] = any[], R = any> implements IEffect { #effect: (...args: T) => R; constructor(effect: (...args: T) => R) { this.#effect = effect; } apply(...args: T): R { return this.#effect(...args); } } export default Effect;