import { BotLootCacheService } from "https://deno.land/x/sptaki@1.2.0/services/BotLootCacheService.d.ts";
Constructors
new
BotLootCacheService(logger: ILogger,
jsonUtil: JsonUtil,
itemHelper: ItemHelper,
databaseServer: DatabaseServer,
pmcLootGenerator: PMCLootGenerator,
localisationService: LocalisationService,
ragfairPriceService: RagfairPriceService,
Properties
protected
databaseServer: DatabaseServerprotected
itemHelper: ItemHelperprotected
jsonUtil: JsonUtilprotected
localisationService: LocalisationServiceprotected
logger: ILoggerprotected
lootCache: Record<string, IBotLootCache>protected
pmcLootGenerator: PMCLootGeneratorprotected
ragfairPriceService: RagfairPriceServiceMethods
protected
addItemsToPool(poolToAddTo: Record<string, number>, poolOfItemsToAdd: Record<string, number>): voidprotected
addLootToCache(): voidGenerate loot for a bot and store inside a private class property
protected
addUniqueItemsToPool(poolToAddTo: ITemplateItem[], itemsToAdd: ITemplateItem[]): voidAdd unique items into combined pool
protected
botRoleExistsInCache(botRole: string): booleanCheck if a bot type exists inside the loot cache
protected
compareByValue(itemAPrice: number, itemBPrice: number): numberCompares two item prices by their flea (or handbook if that doesnt exist) price -1 when a < b 0 when a === b 1 when a > b
protected
initCacheForBotRole(botRole: string): voidIf lootcache is null, init with empty property arrays
protected
isBulletOrGrenade(props: Props): booleanAmmo/grenades have this property
protected
isCurrency(tpl: string): booleanprotected
isDrink(tpl: string): booleanprotected
isFood(tpl: string): booleanGrenades have this property (e.g. smoke/frag/flash grenades)
protected
isMagazine(props: Props): booleanInternal and external magazine have this property
protected
isMedicalItem(props: Props): booleanMedical use items (e.g. morphine/lip balm/grizzly)
clearCache(): void
Remove cached bot loot data
getLootFromCache(): Record<string, number>
Get the fully created loot array, ordered by price low to high