56 lines
2.3 KiB
TypeScript
Raw Normal View History

import { ItemHelper } from "@spt/helpers/ItemHelper";
import { IPreset } from "@spt/models/eft/common/IGlobals";
import { BaseClasses } from "@spt/models/enums/BaseClasses";
import { DatabaseService } from "@spt/services/DatabaseService";
import { ICloner } from "@spt/utils/cloners/ICloner";
2023-06-11 15:10:34 +10:00
export declare class PresetHelper {
protected databaseService: DatabaseService;
2024-04-03 20:15:11 +11:00
protected itemHelper: ItemHelper;
protected cloner: ICloner;
2023-06-11 15:10:34 +10:00
protected lookup: Record<string, string[]>;
2024-04-03 20:15:11 +11:00
protected defaultEquipmentPresets: Record<string, IPreset>;
protected defaultWeaponPresets: Record<string, IPreset>;
constructor(databaseService: DatabaseService, itemHelper: ItemHelper, cloner: ICloner);
2023-06-11 15:10:34 +10:00
hydratePresetStore(input: Record<string, string[]>): void;
2024-04-03 20:15:11 +11:00
/**
* Get default weapon and equipment presets
* @returns Dictionary
*/
2023-10-09 20:21:00 +11:00
getDefaultPresets(): Record<string, IPreset>;
2024-04-03 20:15:11 +11:00
/**
* Get default weapon presets
* @returns Dictionary
*/
getDefaultWeaponPresets(): Record<string, IPreset>;
/**
* Get default equipment presets
* @returns Dictionary
*/
getDefaultEquipmentPresets(): Record<string, IPreset>;
2023-06-11 15:10:34 +10:00
isPreset(id: string): boolean;
/**
* Checks to see if the preset is of the given base class.
* @param id The id of the preset
* @param baseClass The BaseClasses enum to check against
* @returns True if the preset is of the given base class, false otherwise
*/
isPresetBaseClass(id: string, baseClass: BaseClasses): boolean;
2023-06-11 15:10:34 +10:00
hasPreset(templateId: string): boolean;
2023-10-09 20:21:00 +11:00
getPreset(id: string): IPreset;
2024-04-03 20:15:11 +11:00
getAllPresets(): IPreset[];
2023-10-09 20:21:00 +11:00
getPresets(templateId: string): IPreset[];
/**
2024-04-03 20:15:11 +11:00
* Get the default preset for passed in item id
* @param templateId Item id to get preset for
2023-10-09 20:21:00 +11:00
* @returns Null if no default preset, otherwise IPreset
*/
getDefaultPreset(templateId: string): IPreset | undefined;
2023-06-11 15:10:34 +10:00
getBaseItemTpl(presetId: string): string;
2024-04-03 20:15:11 +11:00
/**
* Return the price of the preset for the given item tpl, or for the tpl itself if no preset exists
* @param tpl The item template to get the price of
* @returns The price of the given item preset, or base item if no preset exists
*/
getDefaultPresetOrItemPrice(tpl: string): number;
2023-06-11 15:10:34 +10:00
}