import { BotGenerationCacheService } from "https://deno.land/x/sptaki@1.2.0/services/BotGenerationCacheService.d.ts";
Constructors
new
BotGenerationCacheService(logger: ILogger,
randomUtil: RandomUtil,
jsonUtil: JsonUtil,
localisationService: LocalisationService,
botHelper: BotHelper,
Properties
protected
activeBotsInRaid: IBotBase[]protected
botHelper: BotHelperprotected
jsonUtil: JsonUtilprotected
localisationService: LocalisationServiceprotected
logger: ILoggerprotected
randomUtil: RandomUtilprotected
storedBots: Map<string, IBotBase[]>Methods
cacheHasBotOfRole(key: string): boolean
Does cache have a bot with requested key
clearStoredBots(): void
Remove all cached bot profiles from memory
Find and return a bot based on its role Remove bot from internal array so it can't be retreived again
getUsedBot(profileId: string): IBotBase
Get a bot by its profileId that has been generated and sent to client for current raid Cache is wiped post-raid in client/match/offline/end endOfflineRaid()
Store array of bots in cache, shuffle results before storage
storeUsedBot(botToStore: IBotBase): void
Cache a bot that has been sent to the client in memory for later use post-raid to determine if player killed a traitor scav