Update types
This commit is contained in:
parent
e9ee501590
commit
1d7113a549
@ -28,9 +28,5 @@ export declare class BotCallbacks {
|
||||
* @returns string
|
||||
*/
|
||||
getBotCap(): string;
|
||||
/**
|
||||
* Handle /singleplayer/settings/bot/getBotBehaviour/
|
||||
* @returns string
|
||||
*/
|
||||
getBotBehaviour(url: string, info: IEmptyRequestData, sessionID: string): string;
|
||||
getBotBehaviours(): string;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { ApplicationContext } from "../context/ApplicationContext";
|
||||
import { BotGenerator } from "../generators/BotGenerator";
|
||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
||||
@ -12,18 +13,22 @@ import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { BotGenerationCacheService } from "../services/BotGenerationCacheService";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
export declare class BotController {
|
||||
protected logger: ILogger;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected botGenerator: BotGenerator;
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected botGenerationCacheService: BotGenerationCacheService;
|
||||
protected localisationService: LocalisationService;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected applicationContext: ApplicationContext;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer, applicationContext: ApplicationContext);
|
||||
static readonly pmcTypeLabel = "PMC";
|
||||
constructor(logger: ILogger, databaseServer: DatabaseServer, botGenerator: BotGenerator, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, botGenerationCacheService: BotGenerationCacheService, localisationService: LocalisationService, weightedRandomHelper: WeightedRandomHelper, configServer: ConfigServer, applicationContext: ApplicationContext, jsonUtil: JsonUtil);
|
||||
/**
|
||||
* Return the number of bot loadout varieties to be generated
|
||||
* @param type bot Type we want the loadout gen count for
|
||||
@ -39,7 +44,6 @@ export declare class BotController {
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficulty(type: string, difficulty: string): Difficulty;
|
||||
protected getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
|
||||
/**
|
||||
* Generate bot profiles and store in cache
|
||||
* @param sessionId Session id
|
||||
@ -53,5 +57,5 @@ export declare class BotController {
|
||||
* @returns cap number
|
||||
*/
|
||||
getBotCap(): number;
|
||||
getPmcBotType(botType: string): string;
|
||||
getPmcBotTypes(): Record<string, Record<string, Record<string, number>>>;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { BotDifficultyHelper } from "../helpers/BotDifficultyHelper";
|
||||
import { BotHelper } from "../helpers/BotHelper";
|
||||
import { GameEventHelper } from "../helpers/GameEventHelper";
|
||||
import { ProfileHelper } from "../helpers/ProfileHelper";
|
||||
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
||||
import { IGenerateBotsRequestData } from "../models/eft/bot/IGenerateBotsRequestData";
|
||||
import { Health as PmcHealth, IBotBase, Skills } from "../models/eft/common/tables/IBotBase";
|
||||
import { Health, IBotType, Inventory } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
@ -31,10 +31,11 @@ export declare class BotGenerator {
|
||||
protected botEquipmentFilterService: BotEquipmentFilterService;
|
||||
protected weightedRandomHelper: WeightedRandomHelper;
|
||||
protected botHelper: BotHelper;
|
||||
protected botDifficultyHelper: BotDifficultyHelper;
|
||||
protected gameEventHelper: GameEventHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer);
|
||||
constructor(logger: ILogger, hashUtil: HashUtil, randomUtil: RandomUtil, jsonUtil: JsonUtil, profileHelper: ProfileHelper, databaseServer: DatabaseServer, botInventoryGenerator: BotInventoryGenerator, botEquipmentFilterService: BotEquipmentFilterService, weightedRandomHelper: WeightedRandomHelper, botHelper: BotHelper, botDifficultyHelper: BotDifficultyHelper, gameEventHelper: GameEventHelper, configServer: ConfigServer);
|
||||
/**
|
||||
* Generate a player scav bot object
|
||||
* @param role e.g. assault / pmcbot
|
||||
@ -44,12 +45,12 @@ export declare class BotGenerator {
|
||||
*/
|
||||
generatePlayerScav(sessionId: string, role: string, difficulty: string, botTemplate: IBotType): IBotBase;
|
||||
/**
|
||||
* Generate an array of bot objects for populate a raid with
|
||||
* Generate an array of bot objects based on a condition for a raid with
|
||||
* @param sessionId session id
|
||||
* @param info request object
|
||||
* @param condition request condition
|
||||
* @returns bot array
|
||||
*/
|
||||
generate(sessionId: string, info: IGenerateBotsRequestData): IBotBase[];
|
||||
generateByCondition(sessionId: string, botCountToGenerate: number, difficulty: string, role: string, isPmc: boolean): IBotBase[];
|
||||
/**
|
||||
* Get the PMCs wildSpawnType value
|
||||
* @param role "usec" / "bear"
|
||||
|
46
TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts
vendored
Normal file
46
TypeScript/1LogToConsole/types/helpers/BotDifficultyHelper.d.ts
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
import { Difficulty } from "../models/eft/common/tables/IBotType";
|
||||
import { IBotConfig } from "../models/spt/config/IBotConfig";
|
||||
import { ILogger } from "../models/spt/utils/ILogger";
|
||||
import { ConfigServer } from "../servers/ConfigServer";
|
||||
import { DatabaseServer } from "../servers/DatabaseServer";
|
||||
import { LocalisationService } from "../services/LocalisationService";
|
||||
import { JsonUtil } from "../utils/JsonUtil";
|
||||
import { RandomUtil } from "../utils/RandomUtil";
|
||||
import { BotHelper } from "./BotHelper";
|
||||
export declare class BotDifficultyHelper {
|
||||
protected logger: ILogger;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected databaseServer: DatabaseServer;
|
||||
protected randomUtil: RandomUtil;
|
||||
protected localisationService: LocalisationService;
|
||||
protected botHelper: BotHelper;
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, botHelper: BotHelper, configServer: ConfigServer);
|
||||
getPmcDifficultySettings(pmcType: "bear" | "usec", difficulty: string, usecType: string, bearType: string): Difficulty;
|
||||
/**
|
||||
* Get difficulty settings for desired bot type, if not found use assault bot types
|
||||
* @param type bot type to retreive difficulty of
|
||||
* @param difficulty difficulty to get settings for (easy/normal etc)
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficultySettings(type: string, difficulty: string): Difficulty;
|
||||
/**
|
||||
* Get difficulty settings for a PMC
|
||||
* @param type "usec" / "bear"
|
||||
* @param difficulty what difficulty to retrieve
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
protected getDifficultySettings(type: string, difficulty: string): Difficulty;
|
||||
/**
|
||||
* Translate chosen value from pre-raid difficulty dropdown into bot difficulty value
|
||||
* @param dropDownDifficulty Dropdown difficulty value to convert
|
||||
* @returns bot difficulty
|
||||
*/
|
||||
convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string;
|
||||
/**
|
||||
* Choose a random difficulty from - easy/normal/hard/impossible
|
||||
* @returns random difficulty
|
||||
*/
|
||||
chooseRandomDifficulty(): string;
|
||||
}
|
@ -15,37 +15,12 @@ export declare class BotHelper {
|
||||
protected configServer: ConfigServer;
|
||||
protected botConfig: IBotConfig;
|
||||
constructor(logger: ILogger, jsonUtil: JsonUtil, databaseServer: DatabaseServer, randomUtil: RandomUtil, localisationService: LocalisationService, configServer: ConfigServer);
|
||||
/**
|
||||
* Get difficulty settings for desired bot type, if not found use assault bot types
|
||||
* @param type bot type to retreive difficulty of
|
||||
* @param difficulty difficulty to get settings for (easy/normal etc)
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getBotDifficultySettings(type: string, difficulty: string): Difficulty;
|
||||
/**
|
||||
* Get a template object for the specified botRole from bots.types db
|
||||
* @param role botRole to get template for
|
||||
* @returns IBotType object
|
||||
*/
|
||||
getBotTemplate(role: string): IBotType;
|
||||
/**
|
||||
* Get difficulty settings for a PMC
|
||||
* @param type "usec" / "bear"
|
||||
* @param difficulty what difficulty to retrieve
|
||||
* @returns Difficulty object
|
||||
*/
|
||||
getPmcDifficultySettings(type: string, difficulty: string): Difficulty;
|
||||
/**
|
||||
* Translate chosen value from pre-raid difficulty dropdown into bot difficulty value
|
||||
* @param dropDownDifficulty Dropdown difficulty value to convert
|
||||
* @returns bot difficulty
|
||||
*/
|
||||
convertBotDifficultyDropdownToBotDifficulty(dropDownDifficulty: string): string;
|
||||
/**
|
||||
* Choose a random difficulty from - easy/normal/hard/impossible
|
||||
* @returns random difficulty
|
||||
*/
|
||||
chooseRandomDifficulty(): string;
|
||||
/**
|
||||
* Randomise the chance the PMC will attack their own side
|
||||
* Look up value in bot.json/chanceSameSideIsHostilePercent
|
||||
|
@ -27,6 +27,8 @@ export interface IBotConfig extends IBaseConfig {
|
||||
maxBotCap: Record<string, number>;
|
||||
/** How many stacks of secret ammo should a bot have in its bot secure container */
|
||||
secureContainerAmmoStackCount: number;
|
||||
/** Batch generation size when type not available in cache */
|
||||
botGenerationBatchSizePerType: number;
|
||||
}
|
||||
export interface PresetBatch {
|
||||
assault: number;
|
||||
|
@ -8,7 +8,7 @@ export declare class BotGenerationCacheService {
|
||||
protected randomUtil: RandomUtil;
|
||||
protected jsonUtil: JsonUtil;
|
||||
protected botHelper: BotHelper;
|
||||
protected storedBots: IBotBase[];
|
||||
protected storedBots: Map<string, IBotBase[]>;
|
||||
constructor(logger: ILogger, randomUtil: RandomUtil, jsonUtil: JsonUtil, botHelper: BotHelper);
|
||||
/**
|
||||
* Store array of bots in cache, shuffle results before storage
|
||||
@ -21,25 +21,7 @@ export declare class BotGenerationCacheService {
|
||||
* @param role role to retreive (assault/bossTagilla etc)
|
||||
* @returns IBotBase object
|
||||
*/
|
||||
getBot(role: string): IBotBase[];
|
||||
/**
|
||||
* Find a bot by its index from cache
|
||||
* @param indexOfBotToReturn index to find bot by
|
||||
* @returns bot profile
|
||||
*/
|
||||
protected getBotFromCache(indexOfBotToReturn: number): IBotBase;
|
||||
/**
|
||||
* Remove bot profile by index from cache
|
||||
* @param indexOfBotToReturn Index of bot profile to remove
|
||||
*/
|
||||
protected removeBotFromCache(indexOfBotToReturn: number): void;
|
||||
/**
|
||||
* Get index of bot profile that matches criteria
|
||||
* @param role Role of bot wanted
|
||||
* @param getPmc Requested bot a pmc
|
||||
* @returns index of found bot, -1 if not found
|
||||
*/
|
||||
protected getIndexOfBotToReturn(role: string, getPmc: boolean): number;
|
||||
getBot(role: string): IBotBase;
|
||||
/**
|
||||
* Remove all cached bot profiles
|
||||
*/
|
||||
@ -48,5 +30,5 @@ export declare class BotGenerationCacheService {
|
||||
* Does cache have bots
|
||||
* @returns true if empty
|
||||
*/
|
||||
cacheIsEmpty(): boolean;
|
||||
cacheHasBotOfRole(role: string): boolean;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user