ClearVision/types/services/BotGenerationCacheService.d.ts

35 lines
1.2 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";
export declare class BotGenerationCacheService {
protected logger: ILogger;
protected randomUtil: RandomUtil;
protected jsonUtil: JsonUtil;
protected botHelper: BotHelper;
2022-11-20 14:59:15 -05:00
protected storedBots: Map<string, IBotBase[]>;
2022-10-06 23:29:01 -04:00
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper);
/**
* 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
*/
storeBots(botsToStore: IBotBase[]): void;
/**
* Find and return a bot based on its role
* Remove bot from internal array so it can't be retreived again
* @param role role to retreive (assault/bossTagilla etc)
* @returns IBotBase object
*/
2022-11-20 14:59:15 -05:00
getBot(role: string): IBotBase;
2022-10-06 23:29:01 -04:00
/**
* Remove all cached bot profiles
*/
clearStoredBots(): void;
/**
* Does cache have bots
* @returns true if empty
*/
2022-11-20 14:59:15 -05:00
cacheHasBotOfRole(role: string): boolean;
2022-10-06 23:29:01 -04:00
}