Valens-Progression/types/services/BotGenerationCacheService.d.ts

37 lines
1.4 KiB
TypeScript
Raw Normal View History

import { BotHelper } from "../helpers/BotHelper";
import { IBotBase } from "../models/eft/common/tables/IBotBase";
import { ILogger } from "../models/spt/utils/ILogger";
import { JsonUtil } from "../utils/JsonUtil";
import { RandomUtil } from "../utils/RandomUtil";
2022-12-25 18:45:30 -05:00
import { LocalisationService } from "./LocalisationService";
export declare class BotGenerationCacheService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
2022-12-25 18:45:30 -05:00
protected localisationService: LocalisationService;
protected botHelper: BotHelper;
2022-12-25 18:45:30 -05:00
protected storedBots: Map<string, IBotBase[]>;
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper);
/**
* Store array of bots in cache, shuffle results before storage
2022-12-25 18:45:30 -05:00
* @param botsToStore Bots we want to store in the cache
*/
2022-12-25 18:45:30 -05:00
storeBots(key: string, botsToStore: IBotBase[]): void;
/**
* Find and return a bot based on its role
* Remove bot from internal array so it can't be retreived again
2022-12-25 18:45:30 -05:00
* @param key role to retreive (assault/bossTagilla etc)
* @returns IBotBase object
*/
2022-12-25 18:45:30 -05:00
getBot(key: string): IBotBase;
/**
* Remove all cached bot profiles
*/
clearStoredBots(): void;
2022-12-25 18:45:30 -05:00
/**
* Does cache have a bot with requested key
* @returns false if empty
*/
cacheHasBotOfRole(key: string): boolean;
}