Skip to main content
The Deno 2 Release Candidate is here
Learn more
class HandbookHelper
import { HandbookHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/HandbookHelper.d.ts";

Constructors

new
HandbookHelper(
databaseServer: DatabaseServer,
jsonUtil: JsonUtil,
configServer: ConfigServer,
)

Properties

protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
handbookPriceCache: LookupCollection
protected
itemConfig: IItemConfig
protected
jsonUtil: JsonUtil
protected
lookupCacheGenerated: boolean

Methods

childrenCategories(categoryParent: string): string[]

Get all items associated with a categories parent

fromRUB(roubleCurrencyCount: number, currencyTypeTo: string): number

Convert roubles into another currency

getCategoryById(handbookId: string): Category
getTemplatePrice(tpl: string): number

Get price from internal cache, if cache empty look up price directly in handbook (expensive) If no values found, return 1

getTemplatePriceForItems(items: Item[]): number

Create an in-memory cache of all items with associated handbook price in handbookPriceCache class

inRUB(nonRoubleCurrencyCount: number, currencyTypeFrom: string): number

Convert non-roubles into roubles

isCategory(category: string): boolean

Does category exist in handbook cache

templatesWithParent(parentId: string): string[]

Get all items in template with the given parent category