This commit is contained in:
Chomp 2022-07-25 20:49:28 +01:00
commit 2b6e6e6ba5
85 changed files with 32 additions and 1627 deletions

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { DependencyContainer } from "tsyringe";
// SPT types
import { IPreAkiLoadMod } from "@spt-aki/models/external/IPreAkiLoadMod";
import { IPostAkiLoadMod } from "@spt-aki/models/external/IPostAkiLoadMod";
import { IPostDBLoadMod } from "@spt-aki/models/external/IPostDBLoadMod";
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { PreAkiModLoader } from "@spt-aki/loaders/PreAkiModLoader";
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
@ -18,13 +18,14 @@ import { ILocaleGlobalBase } from "@spt-aki/models/spt/server/ILocaleBase";
// The new trader config
import * as baseJson from "../db/base.json";
class SampleTrader implements IPreAkiLoadMod, IPostAkiLoadMod {
class SampleTrader implements IPreAkiLoadMod, IPostDBLoadMod {
mod: string
logger: ILogger
constructor() {
this.mod = "13AddTrader";
}
public preAkiLoad(container: DependencyContainer): void {
this.logger = container.resolve<ILogger>("WinstonLogger");
this.logger.debug(`[${this.mod}] Loading... `);
@ -36,7 +37,7 @@ class SampleTrader implements IPreAkiLoadMod, IPostAkiLoadMod {
this.logger.debug(`[${this.mod}] Loaded`);
}
public postAkiLoad(container: DependencyContainer): void {
public postDBLoad(container: DependencyContainer): void {
this.logger.debug(`[${this.mod}] Delayed Loading... `);
const databaseServer = container.resolve<DatabaseServer>("DatabaseServer");

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;

View File

@ -2,7 +2,7 @@ import { BotGeneratorHelper } from "../helpers/BotGeneratorHelper";
import { ItemHelper } from "../helpers/ItemHelper";
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
import { Inventory as PmcInventory } from "../models/eft/common/IPmcData";
import { Inventory, MinMax, Mods, ModsChances } from "../models/eft/common/tables/IBotType";
import { Inventory, MinMax, ModsChances } from "../models/eft/common/tables/IBotType";
import { Item } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
@ -22,35 +22,6 @@ export declare class BotWeaponGenerator {
private readonly modMagazineSlotId;
constructor(jsonUtil: JsonUtil, logger: ILogger, hashUtil: HashUtil, databaseServer: DatabaseServer, itemHelper: ItemHelper, weightedRandomHelper: WeightedRandomHelper, botGeneratorHelper: BotGeneratorHelper, randomUtil: RandomUtil);
generateWeapon(equipmentSlot: string, templateInventory: Inventory, modChances: ModsChances, magCounts: MinMax, botRole: string, isPmc: boolean, inventory: PmcInventory): void;
/**
* Create a list of mods for a weapon defined by the weaponTpl parameter
* @param weaponTpl Weapon to generate mods for
*/
protected getWeaponMods(weaponTpl: string): Mods;
/**
* Get a dictionary of items and their attachments
* @param itemTpl item to look up attachments for
* @param weaponModsResult Mods array to add to
*/
protected getItemAttachmentsRecursive(itemTpl: string, weaponModsResult: Mods): void;
protected isTplAnOptic(tplToCheck: string): boolean;
/**
* Get a weapon tpl from a bot jsons inventory
* @param weaponSlot slot to get randomised tpl for
* @param templateInventory
* @returns
*/
protected getRandomisedWeaponTplForSlot(weaponSlot: string, templateInventory: Inventory): string;
/**
* Get an array with a single object being the the weapon as defined by the weaponTpl parameter
* @param weaponTpl weapon to generate array around
* @param equipmentId
* @param weaponSlot
* @param itemTemplate
* @param botRole bot we're generating for
* @returns Item array
*/
protected getWeaponBase(weaponTpl: string, equipmentId: string, weaponSlot: string, itemTemplate: ITemplateItem, botRole: string): Item[];
/**
* Get the mods necessary to kit out a weapon to its preset level
* @param weaponTpl weapon to find preset for

View File

@ -1,13 +0,0 @@
import { HandbookItem } from "../models/eft/common/tables/IHandbookBase";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomHandbookItemService {
protected logger: ILogger;
private customHandbookItems;
constructor(logger: ILogger);
/**
* Add handbook item
* @param handbookItem item to add
*/
add(handbookItem: HandbookItem): void;
get(): HandbookItem[];
}

View File

@ -1,11 +0,0 @@
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomItemService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customItems;
constructor(logger: ILogger, databaseServer: DatabaseServer);
add(itemToAdd: ITemplateItem): void;
get(): ITemplateItem[];
}

View File

@ -1,14 +0,0 @@
import { CustomTraderAssortData } from "../models/spt/services/CustomTraderAssortData";
import { ILogger } from "../models/spt/utils/ILogger";
import { DatabaseServer } from "../servers/DatabaseServer";
export declare class CustomTraderAssortService {
protected logger: ILogger;
protected databaseServer: DatabaseServer;
private customAssorts;
constructor(logger: ILogger, databaseServer: DatabaseServer);
/**
* Add assorts to a specific trader
*/
add(assortsToAdd: CustomTraderAssortData): void;
get(): CustomTraderAssortData[];
}

View File

@ -1,19 +0,0 @@
import { Preset } from "../models/eft/common/IGlobals";
import { CustomPreset } from "../models/spt/services/CustomPreset";
import { ILogger } from "../models/spt/utils/ILogger";
export declare class CustomPresetService {
protected logger: ILogger;
private customPresets;
constructor(logger: ILogger);
/**
* Add custom preset to internal array
* @param presetKey presets key
* @param presetToAdd preset item to add
*/
add(presetKey: string, presetToAdd: Preset): void;
/**
* Get all custom presets
* @returns
*/
get(): CustomPreset[];
}

View File

@ -3,10 +3,6 @@ import { IDatabaseTables } from "../models/spt/server/IDatabaseTables";
import { ILogger } from "../models/spt/utils/ILogger";
import { ImageRouter } from "../routers/ImageRouter";
import { DatabaseServer } from "../servers/DatabaseServer";
import { CustomHandbookItemService } from "../services/CustomHandbookItemService";
import { CustomItemService } from "../services/CustomItemService";
import { CustomPresetService } from "../services/CustomPresetService";
import { CustomTraderAssortService } from "../services/CustomTraderAssortService";
import { JsonUtil } from "./JsonUtil";
import { VFS } from "./VFS";
export declare class DatabaseImporter extends OnLoad {
@ -14,38 +10,14 @@ export declare class DatabaseImporter extends OnLoad {
protected vfs: VFS;
protected jsonUtil: JsonUtil;
protected databaseServer: DatabaseServer;
protected customItemService: CustomItemService;
protected customTraderAssortService: CustomTraderAssortService;
protected customHandbookItemService: CustomHandbookItemService;
protected customPresetService: CustomPresetService;
protected imageRouter: ImageRouter;
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, customItemService: CustomItemService, customTraderAssortService: CustomTraderAssortService, customHandbookItemService: CustomHandbookItemService, customPresetService: CustomPresetService, imageRouter: ImageRouter);
constructor(logger: ILogger, vfs: VFS, jsonUtil: JsonUtil, databaseServer: DatabaseServer, imageRouter: ImageRouter);
onLoad(): void;
/**
* Read all json files in database folder and map into a json object
* @param filepath path to database folder
*/
protected hydrateDatabase(filepath: string): void;
/**
* Get all items added through CustomItemService and add to database.templates.items
* @param dataToImport db data to amend
*/
protected addCustomItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all assorts added through CustomTraderAssortService and add to database.traders[x].assort
* @param dataToImport db data to amend
*/
protected addCustomTraderAssortsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom handbook items added through CustomHandbookItemService and add to database.templates.handbook.items
* @param dataToImport db data to amend
*/
protected addCustomHandbookItemsToDb(dataToImport: IDatabaseTables): void;
/**
* Get all custom preset items added through CustomPresetService and add to database.globals.ItemPresets
* @param dataToImport
*/
protected addCustomPresetsToDb(dataToImport: IDatabaseTables): void;
getRoute(): string;
loadRecursive(filepath: string): IDatabaseTables;
loadImages(filepath: string): void;