ClearVision/types/services/BotGenerationCacheService.d.ts

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-10-06 23:29:01 -04:00
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";
2023-05-18 15:57:25 -04:00
import { LocalisationService } from "./LocalisationService";
2022-10-06 23:29:01 -04:00
export declare class BotGenerationCacheService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
2023-05-18 15:57:25 -04:00
protected localisationService: LocalisationService;
2022-10-06 23:29:01 -04:00
protected botHelper: BotHelper;
2022-11-20 14:59:15 -05:00
protected storedBots: Map<string, IBotBase[]>;
2023-05-18 15:57:25 -04:00
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, localisationService: LocalisationService, botHelper: BotHelper);
2022-10-06 23:29:01 -04:00
/**
* Store array of bots in cache, shuffle results before storage
2022-11-20 14:59:15 -05:00
* @param botsToStore Bots we want to store in the cache
2022-10-06 23:29:01 -04:00
*/
2023-05-18 15:57:25 -04:00
storeBots(key: string, botsToStore: IBotBase[]): void;
2022-10-06 23:29:01 -04:00
/**
* Find and return a bot based on its role
* Remove bot from internal array so it can't be retreived again
2023-05-18 15:57:25 -04:00
* @param key role to retreive (assault/bossTagilla etc)
2022-10-06 23:29:01 -04:00
* @returns IBotBase object
*/
2023-05-18 15:57:25 -04:00
getBot(key: string): IBotBase;
2022-10-06 23:29:01 -04:00
/**
2023-05-18 15:57:25 -04:00
* Remove all cached bot profiles from memory
2022-10-06 23:29:01 -04:00
*/
clearStoredBots(): void;
/**
2023-05-18 15:57:25 -04:00
* Does cache have a bot with requested key
* @returns false if empty
2022-10-06 23:29:01 -04:00
*/
2023-05-18 15:57:25 -04:00
cacheHasBotOfRole(key: string): boolean;
2022-10-06 23:29:01 -04:00
}