UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

42 lines 1.3 kB
/** * @template A * @example * const allocator = new StrategicResourceAllocator(); * * allocator.addTacticalModule(module); // add some tactical modules * * const resources = [new Resource(1, "a")]; * const actions = await allocator.allocate(resources); // list of actions that use resources * @author Alex Goldring * @copyright Company Named Limited (c) 2025 */ export class StrategicResourceAllocator<A> { /** * * @type {TacticalModule[]} */ modules: TacticalModule[]; /** * @private * @type {Array<function(ActionSequence[]):Promise<ActionSequence[]>>} */ private sequenceTransformers; /** * Add a sequence transformer, these are applied as a final step during resource allocation * @param {function(ActionSequence[]):Promise<ActionSequence[]>} t */ addTransformer(t: (arg0: ActionSequence[]) => Promise<ActionSequence[]>): void; /** * * @param {TacticalModule} module * @returns {boolean} */ addTacticalModule(module: TacticalModule): boolean; /** * @template A * @param {Resource[]} resources * @returns {Promise<A[]>} actions */ allocate<A_1>(resources: Resource[]): Promise<A_1[]>; } //# sourceMappingURL=StrategicResourceAllocator.d.ts.map